Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.knowledgestack.ai/llms.txt

Use this file to discover all available pages before exploring further.

The ks-cookbook repository is a curated collection of self-contained recipes that show Knowledge Stack solving real problems. Each recipe is a single folder with a README.md, a requirements.txt (or package.json), and a script you can run end-to-end.

github.com/knowledgestack/ks-cookbook

Browse, fork, and contribute recipes.

Run any recipe in 60 seconds

1

Clone

git clone https://github.com/knowledgestack/ks-cookbook.git
cd ks-cookbook
2

Set credentials

export KS_API_KEY=sk-user-...
export KS_BASE_URL=https://api.knowledgestack.ai
3

Pick a recipe and run it

cd recipes/rag-with-citations
uv sync
uv run main.py --query "what changed in Q4?"

RAG with citations

Chunk search → LLM answer with grounded inline citations to the source PDFs.

Bulk ingest from S3

Stream a whole bucket through /v1/documents/ingest with backpressure and workflow tracking.

Hybrid search evals

Compare dense vs. full-text vs. hybrid on your corpus with a reproducible eval harness.

LangGraph agent

Multi-tool agent that uses the MCP server to search, summarize, and tag documents.

Streaming chat UI

Next.js + assistant-ui front end consuming /v1/threads/{id}/stream (SSE).

CI ingest pipeline

GitHub Action that re-ingests changed docs on every PR using kscli.

Recipe layout

Every recipe follows the same shape so you can read one and know them all:
recipes/<name>/
├── README.md          # what this shows, prerequisites, run instructions
├── pyproject.toml     # or package.json
├── main.py            # or index.ts — the entrypoint
├── data/              # tiny seed data (or a downloader)
└── tests/             # optional pytest / vitest assertions

Contributing a recipe

We accept PRs against the cookbook repo. A good recipe:
  • runs end-to-end with KS_API_KEY + KS_BASE_URL and nothing else,
  • uses the published ksapi / @knowledge-stack/ksapi SDK or kscli,
  • ships a tiny seed dataset (no large binaries),
  • documents the why in the README.md, not just the how.