Skip to main content
Potpie provides three specialized AI agents that understand your codebase through knowledge graph analysis and systematic code exploration.

How to Use Agents

All agents follow the same usage pattern: create a conversation, send messages, get responses. They differ in what they do with your messages.
1

Create Conversation

Choose your agent and create a conversation
response = requests.post(
    "https://production-api.potpie.ai/api/v1/conversations/",
    headers={"Authorization": "Bearer <firebase_token>"},
    json={
        "user_id": "user_123",
        "title": "Your task description",
        "status": "active",
        "project_ids": ["proj_abc123"],
        "agent_ids": ["codebase_qna_agent"]  # or "code_generation_agent" or "debugging_agent"
    }
)
conversation_id = response.json()["conversation_id"]
2

Send Message

All agents use Form data (not JSON) for messages
message_response = requests.post(
    f"https://production-api.potpie.ai/api/v1/conversations/{conversation_id}/message/",
    headers={"Authorization": "Bearer <firebase_token>"},
    data={
        "content": "Your question, request, or bug report"
    },
    params={"stream": False}
)

answer = message_response.json()["response"]
Message endpoint uses Form data (data=), not JSON (json=). Use multipart/form-data content type.
3

Get Response

All agents return the same response format
{
  response: string           // Markdown-formatted answer
  tool_calls: ToolCall[]     // Tools the agent used
  citations: string[]        // Files referenced
}
Perfect for:
  • “How does this feature work?”
  • “Where is X implemented?”
  • “What files handle Y?”
  • “Show me the authentication flow”
Not ideal for:
  • Making code changes (use Code Agent)
  • Debugging specific bugs (use Debug Agent)