32 production-style flagship agents + 100+ recipes for enterprise RAG β built on MCP, works with every major agent framework.
Quickstart Β· Flagships Β· Recipes Β· Wiki Β· Discord
Knowledge Stack is the document intelligence layer behind your agents β ingestion, chunking, permissions, versioning, citations β exposed as a stable MCP surface that plugs into LangChain, LangGraph, CrewAI, Temporal, OpenAI Agents SDK, pydantic-ai, Claude Desktop, Cursor, and anything else that speaks MCP. Every flagship runs under every framework β same prompt + schema, framework swaps in.
You focus on agent logic. KS manages the knowledge layer.
β New here? Jump to the Quickstart below, or browse the flagships by vertical.
- π Quickstart β
git cloneβ first recipe in ~5 min - π§ Flagships by vertical β 32 production-style agents, grouped by industry
- π Recipes index β 100+ β€100-LOC single-file patterns
- π Framework integrations: LangChain Β· LangGraph Β· CrewAI Β· Temporal Β· OpenAI Agents SDK Β· pydantic-ai Β· Claude Desktop Β· Cursor
- π MCP tools used β the 10 read-only tools every flagship calls
- βοΈ Contributing Β· Industries roadmap Β· Wiki
git clone β first cited recipe in ~5 minutes.
Prereqs: Python 3.11+, uv, a Knowledge Stack API key (sign in at https://app.knowledgestack.ai), and an OpenAI key (gpt-4o; gpt-4o-mini skips grounding and emits empty citations).
git clone https://github.com/knowledgestack/ks-cookbook.git
cd ks-cookbook
cp .env.example .env # then fill in KS_API_KEY + OPENAI_API_KEY
make setup # installs every workspace package + validates envRun your first recipe:
uv run python recipes/icd10_coder/recipe.py \
--note-file recipes/icd10_coder/sample_inputs/deid_visit_001.txtThe agent makes ~10β20 MCP tool calls (search_knowledge, read, β¦), then emits a JSON CodingResult with real chunk_ids pointing into your tenant.
Other quick wins:
uv run python recipes/clause_extractor/recipe.py --contract "Apple 2024 proxy"
uv run python recipes/contract_renewal_checker/recipe.py --contract "Donna Huang software development"
uv run python recipes/aml_sar_narrative/recipe.py --case-id "structuring-cash-deposits"
make help # list every demo targetEach recipe folder has its own README.md with a captured live output and troubleshooting. To adapt a flagship to your own tenant, override CORPUS_FOLDER_ID:
CORPUS_FOLDER_ID=your-folder-id make demo-credit-memo32 flagships. Each links to its own README with the expected corpus, a sample input, and a captured sample output β open one to see exactly what it does before running.
Jump to: Banking Β· Legal Β· Accounting & tax Β· Healthcare Β· Insurance Β· Real estate Β· Sales & revenue Β· HR Β· Engineering Β· Government, pharma, energy
- Credit memo drafter β Cited credit memo from your bank's policy + a borrower's financials.
Tags:bankingcredit-riskunderwritingcommercial-lending - Loan covenant monitor β Flag covenant breaches from quarterly financials.
Tags:bankingcovenant-monitoringcredit-risk - KYC onboarding review β CDD checklist + risk tier against your KYC policy.
Tags:bankingkycamlcompliance - Earnings risk analyzer β Hebbia-style 10-K risk-flag memo with chunk citations.
Tags:financesec-filings10-kinvestment-research
- Contract obligation extractor β Every
shall/must/willobligation from a contract, categorized + cited.
Tags:legalcontractsmsaobligations - MSA redline vs. playbook β Compare an inbound MSA clause-by-clause against your playbook.
Tags:legalcontractsredlinenegotiations - Privacy impact assessment β PIA memo citing GDPR Article 35 + company template.
Tags:legalprivacygdprsecurity
- Rev-rec memo (ASC 606) β Five-step revenue-recognition memo grounded in policy.
Tags:accountingasc-606revenue-recognitionmemos - Audit workpaper drafter β Tie a GL balance to source docs with PCAOB AS 1215 cites.
Tags:accountingauditpcaobworkpapers - Tax position memo β Tax memo citing IRC sections + Treasury Regs.
Tags:taxircresearchmemos
- Prior-authorization letter β Cited prior-auth or appeal letter grounded in payer medical policy.
Tags:healthcareprior-authpayerclinical - Clinical trial eligibility β Match a patient against I/E criteria from a real protocol.
Tags:healthcareclinical-trialseligibilityctms
- Claim adjudication memo β Coverage-analysis memo for a P&C claim.
Tags:insuranceclaimscoverage-analysisp-and-c - Subrogation opportunity review β Recovery potential, citing NAIC Model 902.
Tags:insurancesubrogationclaims - Insurance policy comparison β Side-by-side analysis with explicit coverage gaps.
Tags:insurancepolicy-comparisoncoverage
- Lease abstract β One-page cited abstract (term, rent, renewals, CAM, exclusives).
Tags:real-estateleasescommercial - Zoning compliance check β Proposed use vs. local Land Development Code.
Tags:real-estatezoningcompliancemunicipal
- CSV enrichment β Enrich every CSV row with a short summary from your KB.
Tags:salesdata-enrichmentbatchoperations - Research brief β Cited
.docxresearch brief from your tenant.
Tags:researchreportsanalyst - RFP first draft β RFP responses grounded in past proposals + capability docs.
Tags:salesrfpproposalsgo-to-market - Sales battlecard β Differentiators, objection handlers, win themes.
Tags:salescompetitiveenablement - Compliance questionnaire filler β Auto-complete CAIQ / SIG from your policy docs.
Tags:securitycompliancecaiqsigquestionnaires
- Employee handbook Q&A β Cited answers from the company handbook.
Tags:hrhandbookq-and-a - Job description generator β JD grounded in leveling + comp bands.
Tags:hrrecruitingjob-descriptions
- Incident runbook lookup β PagerDuty alert β runbook + cited remediation.
Tags:engineeringsrerunbooksincident-response - API doc generator β Endpoint β developer docs from OpenAPI + style guide.
Tags:engineeringapidocumentationdevex - Release notes generator β Customer-facing notes from specs + migration guide.
Tags:productengineeringrelease-notes - SOW scope validator β SOW completeness vs. template + methodology.
Tags:proservsowscope-management
- Grant compliance checker β Sub-awardee activity vs. NOFO + 2 CFR 200.
Tags:governmentgrantscompliancecfr - FOIA response drafter β FOIA letter with exemption analysis.
Tags:governmentfoiapublic-records - Adverse event narrative β CIOMS-style AE narrative from drug label + PV SOP.
Tags:pharmapharmacovigilanceciomssafety - NERC CIP evidence pack β Compliance evidence memo for a NERC CIP requirement.
Tags:energynerc-cipcomplianceutilities
Tags are first-class metadata declared in each flagship's pyproject.toml [project] keywords. To find every flagship that uses a given tag, search the repo:
grep -l '"banking"' flagships/*/pyproject.tomlTo add or change tags on a flagship: edit keywords = [...] in its pyproject.toml, then run make tags.
See INDUSTRIES.md for the broader roadmap and proposed next flagships.
Short (β€100 LOC) single-file patterns across LangGraph, raw OpenAI, raw Anthropic, and MCP-only β see recipes/INDEX.md.
Every flagship and recipe in this repo is read-only against your tenant. The 10 MCP tools the agents are allowed to call:
search_knowledge Β· search_keyword Β· read Β· read_around Β· list_contents Β· find Β· get_info Β· view_chunk_image Β· get_organization_info Β· get_current_datetime
That's the full contract. Writes are intentionally not exposed.
- π¬ Discord β fastest place to get implementation and architecture help.
- π£οΈ GitHub Discussions β long-form questions, propose flagships.
- π Issues β bugs, flagship requests, recipe requests, framework integrations.
- π Security: see SECURITY.md. Do not open public issues for vulnerabilities.
If this repo helps you ship, star it β it's the single biggest signal we use to decide which flagships, frameworks, and verticals to prioritize next.
MIT. See LICENSE.