šŸ“š/Knowledge

Discover our public embeddings hosted on Swarm network.

Ask a question to Brian

POST https://api.brianknows.org/api/v0/agent/knowledge

Allows you to send a prompt to Brian and receive a textual response along with the resources used to.

Headers

NameTypeDescription

x-brian-api-key*

String

Brian API key.

Content-Type*

application/json

Body content type.

Request Body

NameTypeDescription

prompt*

String

Prompt used to generate the response.

kb

public-knowledge-box

Knowledge box where you want to search information.

Response
{
  "result": {
    "text": "string",
    "sourceDocuments": [
      {
        "pageContent": "string",
        "metadata": {
          "description": "string",
          "language": "string",
          "source": "string",
          "title": "string"
        }
      },
      ...
    ]
  }
}

Requesting information

curl -XPOST "https://api.brianknows.org/api/v0/agent/knowledge" -H "Content-Type: application/json" -H "x-brian-api-key: API_KEY" -d '{"prompt": "What is Uniswap?"}'
{
  "result": {
    "text": "Uniswap is a decentralized protocol and an automated liquidity protocol that operates on the Ethereum blockchain. It allows users to trade various ERC-20 tokens directly from their Ethereum wallets without the need for intermediaries. Uniswap works on the principle of constant product market maker mechanism, where liquidity providers pool their tokens into smart contracts, which are then used to facilitate trades on the platform.\n\nThe protocol has two main functions: swaps and liquidity provision. Swaps enable users to trade tokens directly with each other by selecting the token they want to send and the token they want to receive. The protocol automatically calculates the exchange rate based on the liquidity available in the respective token pools. The fees earned from each trade are distributed to the liquidity providers in proportion to their contribution.\n\nLiquidity provision is another key feature of Uniswap. Users can become liquidity providers by depositing an equal value of two tokens into a liquidity pool. By doing so, they receive pool tokens representing their share of the liquidity pool. These pool tokens can be later redeemed for the underlying tokens along with a portion of the fees generated by the pool.\n\nUniswap has gained significant popularity in the decentralized finance (DeFi) space due to its user-friendly interface, open and permissionless nature, and its role in enabling efficient and decentralized token swaps. The protocol has also inspired the development of various other decentralized exchanges (DEXs) that implement similar automated market-making mechanisms.",
    "sourceDocuments": [
      {
        "pageContent": "Overview | Uniswap",
        "metadata": {
          "description": "Code",
          "language": "en",
          "source": "https://docs.uniswap.org/concepts/governance/overview",
          "title": "Overview | Uniswap"
        }
      },
      {
        "pageContent": "The Uniswap Protocol | Uniswap",
        "metadata": {
          "description": "Introduction",
          "language": "en",
          "source": "https://docs.uniswap.org/concepts/uniswap-protocol",
          "title": "The Uniswap Protocol | Uniswap"
        }
      },
      {
        "pageContent": "Swaps | Uniswap",
        "metadata": {
          "description": "Introduction",
          "language": "en",
          "source": "https://docs.uniswap.org/concepts/protocol/swaps",
          "title": "Swaps | Uniswap"
        }
      },
      {
        "pageContent": "Glossary | Uniswap",
        "metadata": {
          "description": "- UNI: An ERC-20 token that designates the weight of a user's voting rights. The more UNI a user has in their wallet, the more weight their delegation or vote on a proposal holds.",
          "language": "en",
          "source": "https://docs.uniswap.org/concepts/governance/glossary",
          "title": "Glossary | Uniswap"
        }
      }
    ]
  }
}// Some code

Last updated