Skip to content

About

Minimal, async-first Python framework for production LLM apps- 2 hard deps, no magic, no SaaS.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Β 
Β 

Latest commit

Β 

History

1,023 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SynapseKit

Build production LLM apps with 2 dependencies. Async-native RAG, agents, and graph workflows. No magic, no SaaS, no bloat.

"LangChain for people who hate LangChain."

SynapseKit is a minimal, async-first Python framework for LLM applications: 46 LLM providers, 32 vector stores, 83 data loaders, 56 agent tools, and a dedicated embeddings/reranker layer. Every abstraction is plain Python you can read, debug, and extend. No hidden chains, no global state, no lock-in.


🎬 See it live

SynapseKit Live: watch your agents think

β–Ά Play the demo Β Β·Β  watch every LLM call, tool, retrieval, DB write, knowledge-graph update, cost, and human approval stream live.

SynapseKit Live: a zero-dependency, real-time dashboard built into the framework.

Run the live dashboard locally. Three ways, no extra dependencies (it uses only the Python standard library):

# 1. Zero-touch: set one env var and run your program as usual.
#    The dashboard auto-starts on the first agent/RAG/graph call and opens your browser.
SYNAPSEKIT_LIVE=1 python your_agent.py

# 2. From the CLI: start it, then run your code in another shell.
synapsekit ui --live            # serves http://127.0.0.1:7900

# 3. From code.
python -c "from synapsekit.live import enable; enable()"   # opens the tab; keep the process alive

Or try a ready-made demo that exercises everything (loader β†’ embeddings β†’ retrieval β†’ tools/MCP β†’ memory/DB β†’ knowledge graph β†’ LLM, with logs, a flame graph, and a human approval):

python examples/live_showcase.py          # set ANTHROPIC_API_KEY first for real Claude calls

It opens http://127.0.0.1:7900 and stays live while your process runs. Bound to localhost, token-gated, and a no-op when the env var isn't set (zero overhead in production).


⚑ Async-native

Every API is async/await first.
Sync wrappers for scripts and notebooks.
No event loop surprises.

🌊 Streaming-first

Token-level streaming is the default,
not an afterthought.
Works across all providers.

πŸͺΆ Minimal footprint

2 hard dependencies: numpy + rank-bm25.
Everything else is optional.
Install only what you use.

πŸ”Œ One interface

46 LLM providers and 32 vector stores
behind the same API.
Swap without rewriting.

🧩 Composable

RAG pipelines, agents, and graph nodes
are interchangeable.
Wrap anything as anything.

πŸ” Transparent

No hidden chains.
Every step is plain Python
you can read and override.

10-Line Agent Example

from synapsekit import agent, tool

@tool
def get_weather(city: str) -> str:
    """Get current weather for a city."""
    return f"Sunny, 22Β°C in {city}"

my_agent = agent(
    model="gpt-4o-mini",
    api_key="sk-...",
    tools=[get_weather],
)

print(my_agent.run("What's the weather in Tokyo?"))

SynapseKit vs LangChain vs LlamaIndex

SynapseKit LangChain LlamaIndex
Hard dependencies 2 50+ 20+
Install size ~5 MB ~200 MB+ ~100 MB+
Async-native βœ… Default ⚠️ Partial ⚠️ Partial
Streaming βœ… Default ⚠️ Varies ⚠️ Varies
Cost tracking βœ… Built-in ❌ LangSmith (SaaS) ❌ No
Evaluation / EvalCI βœ… CLI + GitHub Action ❌ LangSmith (SaaS) ⚠️ Built-in
Graph workflows βœ… Built-in ⚠️ LangGraph (separate pkg) ❌ No
Agent federation βœ… Built-in ❌ No ❌ No
Reasoning LLMs βœ… Unified adapter ⚠️ Manual ⚠️ Manual
Structured output βœ… Provider-agnostic ⚠️ Provider-specific ⚠️ Provider-specific
Agent memory backends βœ… 10 built-in ⚠️ Community plugins ⚠️ Community plugins
Observability βœ… Prometheus + Grafana ❌ No ❌ No
Verifiable audit trails βœ… Signed, hash-chained ❌ No ❌ No
Type safety βœ… Strict dataclasses ⚠️ Partial ⚠️ Partial
LLM providers 46 38+ 20+
Stack traces Your code Framework internals Framework internals
License Apache 2.0 MIT MIT

LangChain has more raw integrations and more tutorials. SynapseKit optimizes for a different problem: shipping, debugging, and maintaining an LLM feature in production, where readable code, predictable async behavior, and no surprise SaaS bills actually matter.


What's New

The 2.x line is about trust and autonomy in production: provable agent behavior, self-managing memory, richer retrieval, local-first operation, and policy enforcement at the LLM boundary.

Trust and verification

  • Verifiable Agents: signed, hash-chained audit trails (Ed25519, pluggable KMS/BYOK) with a standalone verifier (MATCH / DRIFT / UNVERIFIABLE)
  • Guardrails: policy middleware for any BaseLLM, block/redact/flag/require-human modes, prompt-injection and jailbreak guards, PII redaction, HIPAA/GDPR/PCI-DSS rulepacks, signed audit trail
  • NeuroSymbolicAgent: LLM-proposed constraints checked by Z3, SymPy, MiniZinc, or Prolog
  • Orchestration Eval: detects handoff loops, per-transfer context loss, and non-deterministic mis-routing across multi-agent runs

Memory and retrieval

  • Living Memory: agents propose signed, diffable memory patches instead of overwriting files
  • Property Graph RAG and WorldModelRAG: vector search fused with graph traversal and temporal, causal knowledge graphs
  • Personal Knowledge Mesh: local-first incremental indexing across your machine, with a synapsekit mesh CLI and MCP tools
  • A dedicated embeddings and reranker provider layer (9 hosted providers), cloud persistence backends for agent memory and graph checkpoints

Agents

  • AgentSwarm: market-based routing (sealed-bid, Vickrey, English, coalition auctions) with reputation learning
  • SelfImprovingAgent: eval-gated config evolution with signed patches and canary rollout
  • EdgeRuntime: local-first inference with policy-gated cloud fallback and on-device PII redaction
  • Hive Mode, Agent OS Shell, Dream Mode, Ambient daemon, and a Code Archaeology agent for local, autonomous, and history-aware agent workflows

Operations

  • SynapseKit Live: a zero-dependency real-time dashboard for every LLM call, tool, retrieval, and cost
  • Official Docker images on GHCR, a CAG/RAG router with a llama.cpp KV-cache backend, and a sandboxed PC Twin for safe automation

Full history in CHANGELOG.md. Upgrading from 1.x? See the Migrating to 2.0 guide.

pip install --upgrade synapsekit

Computer Use

ComputerUseAgent lets a model work through a screen provider instead of an API. It observes the current screen, asks a provider for one normalized action, applies a SafetyPolicy, executes the action, and records a replayable session log.

from synapsekit import (
    AnthropicComputerUseProvider,
    BrowserScreenProvider,
    ComputerUseAgent,
    SafetyPolicy,
)

agent = ComputerUseAgent(
    provider=AnthropicComputerUseProvider(client=anthropic_client, model="claude-3-5-sonnet"),
    screen=BrowserScreenProvider(headless=True, allowed_domains=["example.com"]),
    safety=SafetyPolicy(
        confirm_before=["delete", "send", "purchase", "navigate_to_new_domain"],
        forbidden_apps=["keychain", "1password"],
        record_session=True,
    ),
    recorder="runs/computer-use-session.jsonl",
)

result = await agent.run("Open the legacy form, enter the invoice total, and stop.")

Install with pip install "synapsekit[computer-use]". Read Computer Use Safety before running this against real desktops, browsers, credentials, or production systems.


Who is it for?

SynapseKit is for Python developers who want to ship LLM features without fighting their framework.

  • Burned LangChain users: hit a wall with debugging, dependency hell, or version churn and want full control back
  • Async backend engineers: building FastAPI services where LangChain's sync-first model feels bolted on
  • Cost-conscious teams: startups that don't want a LangSmith subscription for basic observability
  • ML engineers: building RAG or agent pipelines who need full control over retrieval, prompting, and tool use

Core Capabilities

πŸ—‚ RAG Pipelines Streaming retrieval, BM25 reranking, conversation memory, token tracing, and optional visual-page retrieval for scanned PDFs and slide decks. Load from PDFs, URLs, CSVs, HTML, directories, and 83 total sources.
πŸ€– Agents ReAct loop (any LLM) and native function calling (OpenAI, Anthropic, Gemini, Mistral). 56 built-in tools, fully extensible.
πŸ”€ Graph Workflows DAG-based async pipelines. Nodes run in waves; parallel nodes execute concurrently. Conditional routing, typed state, fan-out/fan-in, SSE streaming, human-in-the-loop, checkpointing, Mermaid export.
🧠 LLM Providers 46 providers behind one BaseLLM interface, auto-detected from the model name. Swap without rewriting.
πŸ—„ Vector Stores 32 backends behind one VectorStore interface, from a zero-dependency InMemoryVectorStore to managed cloud services.
πŸ”Ž Embeddings & Reranking A provider-agnostic BaseEmbeddings contract and Reranker interface across 9 hosted providers, plus lazy ColPali/ColQwen multimodal embeddings for visual-page retrieval.
🧠 Reasoning LLMs ReasoningLLM unifies o1/o3, Claude thinking, Gemini thinking, DeepSeek R1, and Qwen QwQ behind one adapter with a thinking trace.
βš–οΈ Cost-Quality Routing CostQualityRouter explores candidates then exploits the cheapest model meeting your quality bar, with an optional hard budget cap.
🎯 Prompt Optimization PromptOptimizer scores prompt variants against an @eval_case suite and returns the best candidate.
🌐 Federated Retrieval FederatedRetriever fans out to local and remote retrievers in parallel with RRF or score-fusion merging.
🧠 Smart Context Manager Hierarchical context windows with automatic Anthropic prompt-caching tags, cutting repeated-call cost significantly.
βœ… Structured Output Wraps any LLM, validates against a Pydantic v2 model, retries on schema failure, streams via incremental JSON parsing.
πŸ•Έ Agent Federation & Swarm Route prompts across a registry of agents by cost, capacity, or market-based bidding, with reputation tracking.
πŸ” Continuous Fine-Tuning ContinuousTrainer closes the loop from production feedback to a deployed fine-tuned model, with A/B routing and rollout guards.
πŸ§ͺ EvalCI GitHub Action that runs @eval_case suites on every PR and blocks merge on quality regression. Marketplace
πŸ“Š Agent Benchmarking Run GAIA, SWE-bench, WebArena, and AgentBench from the CLI, or publish and pull community eval suites via synapsekit bench.
⚑ Performance orjson, uvloop, xxhash, vectorized MMR, __slots__ on hot paths, optional Rust extension. pip install synapsekit[performance].

ReasoningAgent (automatic routing)

from synapsekit import ReasoningAgent, ReasoningAgentConfig
from synapsekit.agents.tools import CalculatorTool
from synapsekit.llm import LLMConfig, OpenAILLM, ReasoningLLM

agent = ReasoningAgent(
    ReasoningAgentConfig(
        fast_llm=OpenAILLM(LLMConfig(model="gpt-4o-mini", api_key="sk-...", provider="openai")),
        reasoning_llm=ReasoningLLM(model="o3", api_key="sk-..."),
        tools=[CalculatorTool()],
        agent_type="function_calling",
    )
)

answer = await agent.run("Solve: find the eigenvalues of [[2,1],[1,2]]")

Routes simple requests to the fast model and escalates to the reasoning model only when needed. Full docs: docs/evalhub.md for EvalHub, CHANGELOG.md for everything else.


Integrations

One interface. 226+ integrations. Zero lock-in.

🧠 LLM Providers πŸ—„ Vector Stores πŸ“‚ Data Loaders πŸ”§ Agent Tools πŸ”Ž Embeddings
46 32 83 56 9

Every integration is pip install synapsekit[name], nothing else. Swap providers, vector stores, or loaders without touching your application code.

Icons use Google Favicons for reliability across light and dark themes.

🧠 LLM Providers: 46 supported

Every provider implements the same BaseLLM interface. Auto-detected from model name: gpt-4o β†’ OpenAI, claude-* β†’ Anthropic, gemini-* β†’ Google. Swap without rewriting.

Show all 46 providers
OpenAI
OpenAI
Anthropic
Anthropic
Google Gemini
Gemini
Azure OpenAI
Azure OpenAI
AWS Bedrock
AWS Bedrock
Vertex AI
Vertex AI
Mistral
Mistral
Cohere
Cohere
Groq
Groq
Hugging Face
Hugging Face
Cloudflare
Cloudflare
Databricks
Databricks
Perplexity
Perplexity
Replicate
Replicate
xAI Grok
xAI (Grok)
Baidu ERNIE
Baidu ERNIE
DeepSeek
DeepSeek
Ollama
Ollama
Together AI
Together AI
OpenRouter
OpenRouter
Fireworks AI
Fireworks AI
Cerebras
Cerebras
SambaNova
SambaNova
NovitaAI
NovitaAI
Writer
Writer
AI21 Labs
AI21 Labs
Aleph Alpha
Aleph Alpha
Minimax
Minimax
Moonshot
Moonshot
Zhipu
Zhipu
LM Studio
LM Studio
llama.cpp
llama.cpp
vLLM
vLLM
GPT4All
GPT4All
MLX
MLX
NVIDIA NIM
NVIDIA NIM
watsonx.ai
watsonx.ai
Snowflake Cortex
Cortex
DeepInfra
DeepInfra
Nebius
Nebius
Baseten
Baseten
Upstage
Upstage
Reka
Reka
Hyperbolic
Hyperbolic
FriendliAI
FriendliAI
Clarifai
Clarifai

πŸ—„ Vector Stores: 32 backends

All implement VectorStore with add(), search(), search_mmr(), save(), and load(). Built-in InMemoryVectorStore needs zero extra deps. Everything else is pip install synapsekit[name].

Show all 32 backends
ChromaDB
ChromaDB
FAISS
FAISS
Qdrant
Qdrant
Pinecone
Pinecone
Weaviate
Weaviate
Milvus
Milvus
LanceDB
LanceDB
PGVector
PGVector
SQLiteVec
SQLiteVec
MongoDB Atlas
MongoDB Atlas
Redis
Redis
Elasticsearch
Elasticsearch
OpenSearch
OpenSearch
Supabase
Supabase
Cassandra
Cassandra
DuckDB
DuckDB
ClickHouse
ClickHouse
Marqo
Marqo
Typesense
Typesense
Vespa
Vespa
Zilliz
Zilliz
Vector-store integration validation notes

The issue #888 adapters use the same async contract and have provider-SDK contract tests. Their live services require credentials or a provider-managed endpoint, so they are intentionally not started by the default CI job:

Backend Live integration status
Turbopuffer Cloud-only; set TURBOPUFFER_API_KEY and run against a namespace
Azure AI Search Azure service; requires an endpoint, admin key, and index
Vertex AI Vector Search Google Cloud service; requires project credentials and a deployed index
SingleStore Managed/self-hosted SQL service; requires a customer endpoint
TiDB Vector TiDB Cloud/self-hosted SQL service; requires a customer endpoint
Couchbase Capella/self-hosted Search service; requires a Search Vector Index
SurrealDB SurrealDB server; requires a running instance and credentials
Deep Lake Local or Activeloop dataset; requires a dataset path or cloud token
MyScale MyScale Cloud service; requires a service endpoint and credentials

Use the corresponding synapsekit[...] extra and provider setup before running live checks. Search-before-add and persistence-after-reconnect are covered by provider adapters; Vertex AI additionally requires document_store_path because its nearest-neighbour response returns IDs only. The local save()/load() contract is a JSON snapshot that replays documents into the selected backend.


πŸ“‚ Data Loaders: 83 sources

All return list[Document] with .text and .metadata. Every loader has a sync .load() and async .aload(), with the same interface across disk, cloud, databases, and APIs.

Show all 83 sources

File Formats

PDF
PDF
Word
Word (DOCX)
Excel
Excel (XLSX)
PowerPoint
PowerPoint
HTML
HTML / XML
Markdown
Markdown
LaTeX
LaTeX
YAML
YAML / JSON
Parquet
Parquet
Audio
Audio (Whisper)
Video
Video
RSS
RSS / Sitemap
Git Repo
Git Repo

Cloud Storage

AWS S3
AWS S3
Google Drive
Google Drive
Azure Blob
Azure Blob
OneDrive
OneDrive
Dropbox
Dropbox
GCS
Google Cloud

Databases

PostgreSQL
PostgreSQL
MySQL
MySQL
MongoDB
MongoDB
DynamoDB
DynamoDB
Elasticsearch
Elasticsearch
Redis
Redis
BigQuery
BigQuery
Snowflake
Snowflake
SQLite
SQLite
Supabase
Supabase

APIs & Productivity

GitHub
GitHub
Jira
Jira
Confluence
Confluence
Notion
Notion
Slack
Slack
Discord
Discord
HubSpot
HubSpot
Salesforce
Salesforce
Airtable
Airtable
YouTube
YouTube
Reddit
Reddit
Wikipedia
Wikipedia
Obsidian
Obsidian
Google Sheets
Google Sheets
Firebase
Firebase
Twilio
Twilio
arXiv
arXiv
PubMed
PubMed
Email
Email (IMAP)

πŸ”§ Agent Tools: 56 built-in

All implement BaseTool with a single async run(). Pass any list of tools to ReActAgent or FunctionCallingAgent. Write your own in 5 lines.

Show all 56 tools
DuckDuckGo
DuckDuckGo
Google Search
Google Search
Tavily
Tavily
Wolfram Alpha
Wolfram Alpha
Wikipedia
Wikipedia
YouTube
YouTube
arXiv
arXiv
PubMed
PubMed
Slack
Slack
Discord
Discord
GitHub
GitHub API
Jira
Jira
Notion
Notion
Linear
Linear
Stripe
Stripe
Twilio
Twilio
Google Calendar
Google Calendar
AWS Lambda
AWS Lambda
Browser
Browser (Playwright)
SQL
SQL Query
Python REPL
Python REPL
Shell
Shell

🧠 Memory & Cache Backends

SQLite
SQLite
Redis
Redis
PostgreSQL
PostgreSQL
DynamoDB
DynamoDB
Memcached
Memcached

10 backends in total, including MongoDB, Firestore, Cosmos DB, and Cassandra alongside the ones shown above. Persistent memory backend configuration and graph-checkpointer parity are documented in docs/memory/backends.md.

πŸ“‘ Observability

OpenTelemetry
OpenTelemetry
Prometheus
Prometheus
Grafana
Grafana

PrometheusMetrics records synapsekit_cost_usd_total, synapsekit_tokens_total, and synapsekit_latency_seconds per model/provider. Hooks into the existing observe span pipeline, no code changes needed. Helm chart for a Prometheus + Grafana stack ships in assets/helm/synapsekit-observability/. pip install synapsekit[observe].

Multi-Hop Knowledge Graph RAG

SynapseKit provides advanced retrieval modules, including vector search and multi-hop Knowledge Graph (KG) retrieval.

When to use which?

  • Vector Search (Semantic): Best for broad conceptual queries, finding similar passages, or answering questions whose answers are contained within a single chunk of text.
  • Knowledge Graph (KG): Best for specific, multi-hop reasoning questions where the relationship spans across multiple documents (e.g., finding out who owns the parent company of a subsidiary).
  • Hybrid (Vector + KG): Combining both strategies guarantees that you capture deep semantic context while also exploring explicitly extracted entity relationships. Initialize the RAG facade with graph_store=NetworkXStore() or Neo4jStore(...) to enable this out-of-the-box.

Production RAG ROI

from synapsekit import RAG, RAGEvaluator, SlackWebhookAlertSink
from synapsekit.cli.ui_server import create_app

rag = RAG(
    model="gpt-4o-mini",
    api_key="sk-...",
    evaluator=RAGEvaluator(
        judge_llm=judge_llm,  # a cheaper judge model
        sample_rate=0.1,
        alert_sinks=[SlackWebhookAlertSink(webhook_url=SLACK_WEBHOOK_URL)],
    ),
)

app = create_app(tracer=rag.tracer, rag_evaluator=rag.evaluator)
answer = await rag.ask("What changed in the release notes?")
await rag.wait_for_evaluations()

metrics = rag.tracer.summary()
print(metrics["avg_rag_benefit_to_cost"])
print(metrics["total_rag_alerts"])

Don't see your stack? Every integration is built the same way. Most take under an hour. Browse good first issue β†’ Β· Contributing guide β†’ Β· Discord β†’

We credit every contributor in the README and send a personal thank-you on Discord.


Install

pip

pip install synapsekit[openai]       # OpenAI
pip install synapsekit[anthropic]    # Anthropic + prompt caching
pip install synapsekit[ollama]       # Ollama (local)
pip install synapsekit[performance]  # orjson + uvloop + xxhash (faster)
pip install synapsekit[observe]      # OpenTelemetry + Prometheus metrics
pip install synapsekit[training]     # Continuous fine-tuning pipeline
pip install synapsekit[bench]        # pytest-benchmark + ASV harness
pip install synapsekit[redis]        # Redis agent registry + memory backends
pip install synapsekit[all]          # Everything

uv

uv add synapsekit[openai]
uv add synapsekit[all]

Poetry

poetry add synapsekit[openai]
poetry add "synapsekit[all]"

Docker. Official images on GitHub Container Registry, no Python setup required:

# Core library + CLI
docker pull ghcr.io/synapsekit/synapsekit:latest
docker run --rm ghcr.io/synapsekit/synapsekit --version

# Batteries-included (all extras baked in)
docker pull ghcr.io/synapsekit/synapsekit:all

# Serve a SynapseKit app as an HTTP API (bind 0.0.0.0 inside the container)
docker run --rm -p 8000:8000 -v "$PWD:/app" -w /app \
  ghcr.io/synapsekit/synapsekit serve my_module:rag --host 0.0.0.0

Tags: :latest / :<version> (core) and :all / :<version>-all (all extras). A matching image is published automatically on every release.

Full installation options β†’ docs

Observability guide β†’ docs/observability.md


Documentation

Everything you need to get started and go deep is in the docs.

πŸš€ Quickstart Up and running in 5 minutes
πŸ—‚ RAG Pipelines, loaders, retrieval, vector stores
πŸ€– Agents ReAct, function calling, tools, executor
πŸ”€ Graph Workflows DAG pipelines, conditional routing, parallel execution
🧠 LLM Providers All 46 providers + ReasoningLLM with examples
πŸ§ͺ EvalCI LLM quality gates on every PR, as a GitHub Action
πŸ“– API Reference Full class and method reference

Development

git clone https://github.com/SynapseKit/SynapseKit
cd SynapseKit
uv sync --group dev
uv run pytest tests/ -q

Contributing

Contributions are welcome: bug reports, documentation fixes, new providers, new features.

Read CONTRIBUTING.md to get started. Look for issues tagged good first issue if you're new.


Community


Contributors

Nautiverse
Nautiverse

πŸ’» πŸ“– 🚧
Gordienko Andrey
Gordienko Andrey

πŸ’»
Deepak singh
Deepak singh

πŸ’»
by22Jy
by22Jy

πŸ’»
Arjun Kundapur
Arjun Kundapur

πŸ’»
Harshit Gupta
Harshit Gupta

πŸ“–
Dhruv Garg
Dhruv Garg

πŸ’»
Adam Silva
Adam Silva

πŸ’»
qorex
qorex

πŸ’»
Abhay Krishna
Abhay Krishna

πŸ’»
AYUSH BHATT
AYUSH BHATT

πŸ’»
HARSH
HARSH

πŸ“–
mikemolinet
mikemolinet

πŸ’» πŸ›
Alessandro Mecca
Alessandro Mecca

πŸ’» πŸ›
Prem Mishra
Prem Mishra

πŸ’»
MohamedIdhries
MohamedIdhries

πŸ’»

License

Apache 2.0

About

Minimal, async-first Python framework for production LLM apps- 2 hard deps, no magic, no SaaS.

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages