Connect your own agent to Business Knowledge

Private beta

Business Knowledge is in private beta. If Business Knowledge isn't in your PostHog sidebar, your project isn't in the beta yet. Send feedback in the app.

An agent you build can answer from the same sources PostHog AI and Support use. A support agent, a help desk, a coding agent, or an internal tool connects to Business Knowledge through the PostHog MCP server and searches your sources when it needs a fact.

The agent signs in with a project secret API key and not as a PostHog user. It can read the Business Knowledge the key covers. It can't change anything, and it can't read other PostHog data.

How to connect an agent

You need to be a project admin to create a key.

  1. Choose what the agent can read

    Required

    A key covers either one library or all the Business Knowledge in the project. A library is a group of sources and repositories.

    Give each agent the smallest set it needs. For example, put your public docs in one library for a customer-facing agent, and keep internal policies in another.

  2. Create a key

    Required

    Open Business Knowledge settings and find Connect your agent.

    1. Choose All business knowledge or one library
    2. Enter a name for the key, such as the name of the agent
    3. Click Create key

    PostHog shows the new key once, inside a ready-to-copy configuration. Copy it before you leave the page.

  3. Add the MCP server to your agent

    Required

    Add this server to your agent's MCP configuration. Most agents and agent frameworks accept this format:

    JSON
    {
    "mcpServers": {
    "business-knowledge": {
    "url": "https://mcp.posthog.com/mcp/business-knowledge",
    "headers": {
    "Authorization": "Bearer <your project secret API key>"
    }
    }
    }
    }

    The URL is the same for every project, in both the US and EU regions. PostHog finds your project and region from the key.

  4. Ask a question

    Checkpoint

    Ask your agent something only your sources can answer, such as your refund policy. The agent searches Business Knowledge and answers from the result.

    If the agent finds nothing, check that the source is ready and that it's in the library the key covers.

Keep the key on your server

Anyone who has the key can read the Business Knowledge it covers. Don't put it in a website or a mobile app.

What the agent can do

The connection gives the agent six read-only tools.

ToolWhat it does
business-knowledge-documents-searchSearches your sources and returns the matching passages
business-knowledge-document-window-retrieveReads the text around a search result
business-knowledge-libraries-listLists the libraries the key covers
business-knowledge-libraries-retrieveGets one library
business-knowledge-repositories-searchFinds files by name and README in your selected GitHub repositories
business-knowledge-repositories-file-retrieveReads a file from a selected repository

The agent can't add, edit, or delete sources, and it has no access to events, persons, insights, or any other PostHog data.

What a key covers

ChoiceWhat the agent reads
All business knowledgeEvery source and selected repository in the project, in a library or not
One libraryThe sources and repositories in that library

A project secret API key that you create in project settings with the business_knowledge:read scope also reads all your Business Knowledge.

The table under Connect your agent lists each key, what it reads, and when an agent last used it.

If you delete a library, a key limited to that library reads nothing. Create a new key for another library.

Roll or delete a key

Roll or delete a key under Project secret API keys in project settings. An agent that uses a deleted key loses access immediately.

How this differs from the main PostHog MCP server

Business Knowledge endpointPostHog MCP server
URLhttps://mcp.posthog.com/mcp/business-knowledgehttps://mcp.posthog.com/mcp
Signs in withA project secret API keyA PostHog user, through OAuth or a personal API key
Built forAn agent you build and run for your customers or teamYour own coding agent or AI client
AccessRead-only Business Knowledge toolsThe PostHog tools your user and scopes allow

Each endpoint accepts only its own kind of credential. A project secret API key doesn't work on the main MCP server, and a personal API key doesn't work on the Business Knowledge endpoint.

Still have questions?

Was this page useful?