Documentation

Three ways to interact with Phiacta: REST API, Python SDK, or MCP server.

Python SDK

Typed async client for the Phiacta API

The Python SDK provides typed access to every API endpoint. Async-first with Pydantic models. Authenticate with a personal access token.

Install

pip install git+https://github.com/Noah-Everett/phiacta-sdk-python.git

Create an entry

import asyncio
from phiacta_sdk import PhiactaClient

async def main():
    async with PhiactaClient(
        base_url="https://api.phiacta.com",
        token="<your-token>",
    ) as client:
        entry = await client.create_entry({
            "title": "Euler's identity",
            "entry_type": "theorem",
            "summary": "e^(iπ) + 1 = 0",
            "content": "Euler's identity states that...",
            "tags": ["mathematics", "complex-analysis"],
        })
        print(f"Created: {entry.id}")

asyncio.run(main())

Search entries

search = client.tool("search")
results = await search.get("/", params={"q": "quantum"})

for item in results["items"]:
    print(f"{item['title']} (rank: {item['rank']:.2f})")

Add a reference

refs = client.extension("references")
await refs.post(
    f"/{entry_id}",
    json={
        "target_entry_id": "<target-id>",
        "rel": "cites",
        "note": "Key prior work",
    },
    auth=True,
)
Async/await Pydantic models Plugin namespace helpers