synapse-framework 0.2.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. synapse_framework-0.2.4/LICENSE +21 -0
  2. synapse_framework-0.2.4/PKG-INFO +415 -0
  3. synapse_framework-0.2.4/README.md +364 -0
  4. synapse_framework-0.2.4/pyproject.toml +94 -0
  5. synapse_framework-0.2.4/setup.cfg +4 -0
  6. synapse_framework-0.2.4/synapse/__init__.py +207 -0
  7. synapse_framework-0.2.4/synapse/app.py +942 -0
  8. synapse_framework-0.2.4/synapse/cli.py +88 -0
  9. synapse_framework-0.2.4/synapse/config.py +103 -0
  10. synapse_framework-0.2.4/synapse/connectors/__init__.py +29 -0
  11. synapse_framework-0.2.4/synapse/connectors/base.py +222 -0
  12. synapse_framework-0.2.4/synapse/connectors/factory.py +202 -0
  13. synapse_framework-0.2.4/synapse/connectors/gmail.py +292 -0
  14. synapse_framework-0.2.4/synapse/connectors/mcp_wrapper.py +153 -0
  15. synapse_framework-0.2.4/synapse/connectors/notion.py +161 -0
  16. synapse_framework-0.2.4/synapse/connectors/photos.py +141 -0
  17. synapse_framework-0.2.4/synapse/database/__init__.py +19 -0
  18. synapse_framework-0.2.4/synapse/database/base.py +63 -0
  19. synapse_framework-0.2.4/synapse/database/chroma.py +175 -0
  20. synapse_framework-0.2.4/synapse/database/memory.py +132 -0
  21. synapse_framework-0.2.4/synapse/database/pgvector.py +99 -0
  22. synapse_framework-0.2.4/synapse/database/qdrant.py +138 -0
  23. synapse_framework-0.2.4/synapse/embeddings/__init__.py +21 -0
  24. synapse_framework-0.2.4/synapse/embeddings/base.py +262 -0
  25. synapse_framework-0.2.4/synapse/export/__init__.py +14 -0
  26. synapse_framework-0.2.4/synapse/export/mcp_exporter.py +202 -0
  27. synapse_framework-0.2.4/synapse/graph/__init__.py +21 -0
  28. synapse_framework-0.2.4/synapse/graph/base.py +130 -0
  29. synapse_framework-0.2.4/synapse/graph/memory.py +20 -0
  30. synapse_framework-0.2.4/synapse/graph/neo4j_store.py +176 -0
  31. synapse_framework-0.2.4/synapse/graph/networkx_store.py +221 -0
  32. synapse_framework-0.2.4/synapse/inspector/__init__.py +5 -0
  33. synapse_framework-0.2.4/synapse/inspector/template.py +530 -0
  34. synapse_framework-0.2.4/synapse/models/__init__.py +73 -0
  35. synapse_framework-0.2.4/synapse/models/base.py +95 -0
  36. synapse_framework-0.2.4/synapse/models/gemini.py +328 -0
  37. synapse_framework-0.2.4/synapse/models/ollama.py +322 -0
  38. synapse_framework-0.2.4/synapse/models/openai.py +289 -0
  39. synapse_framework-0.2.4/synapse/oauth/__init__.py +7 -0
  40. synapse_framework-0.2.4/synapse/oauth/google.py +194 -0
  41. synapse_framework-0.2.4/synapse/oauth/notion.py +35 -0
  42. synapse_framework-0.2.4/synapse/rag/__init__.py +8 -0
  43. synapse_framework-0.2.4/synapse/rag/chunker.py +219 -0
  44. synapse_framework-0.2.4/synapse/rag/hybrid_rag.py +122 -0
  45. synapse_framework-0.2.4/synapse/resource/__init__.py +5 -0
  46. synapse_framework-0.2.4/synapse/resource/resource.py +304 -0
  47. synapse_framework-0.2.4/synapse/resources/__init__.py +5 -0
  48. synapse_framework-0.2.4/synapse/skills/__init__.py +5 -0
  49. synapse_framework-0.2.4/synapse/skills/skill.py +321 -0
  50. synapse_framework-0.2.4/synapse/storage/__init__.py +24 -0
  51. synapse_framework-0.2.4/synapse/storage/graph_exporter.py +624 -0
  52. synapse_framework-0.2.4/synapse/storage/graph_store.py +162 -0
  53. synapse_framework-0.2.4/synapse/storage/vector_store.py +103 -0
  54. synapse_framework-0.2.4/synapse_framework.egg-info/PKG-INFO +415 -0
  55. synapse_framework-0.2.4/synapse_framework.egg-info/SOURCES.txt +66 -0
  56. synapse_framework-0.2.4/synapse_framework.egg-info/dependency_links.txt +1 -0
  57. synapse_framework-0.2.4/synapse_framework.egg-info/entry_points.txt +2 -0
  58. synapse_framework-0.2.4/synapse_framework.egg-info/requires.txt +30 -0
  59. synapse_framework-0.2.4/synapse_framework.egg-info/top_level.txt +1 -0
  60. synapse_framework-0.2.4/tests/test_chunker.py +35 -0
  61. synapse_framework-0.2.4/tests/test_connectors.py +45 -0
  62. synapse_framework-0.2.4/tests/test_embeddings.py +142 -0
  63. synapse_framework-0.2.4/tests/test_export.py +138 -0
  64. synapse_framework-0.2.4/tests/test_graph.py +41 -0
  65. synapse_framework-0.2.4/tests/test_rag.py +45 -0
  66. synapse_framework-0.2.4/tests/test_skills_and_resources.py +158 -0
  67. synapse_framework-0.2.4/tests/test_storage_pluggability.py +172 -0
  68. synapse_framework-0.2.4/tests/test_synapse_library.py +123 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Synapse Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,415 @@
1
+ Metadata-Version: 2.4
2
+ Name: synapse-framework
3
+ Version: 0.2.4
4
+ Summary: Modular Multi-MCP & Hybrid RAG AI Application Framework
5
+ Author: Synapse Contributors
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/AKASH-KUMAR-BARPANDA/synapse-framework
8
+ Project-URL: Repository, https://github.com/AKASH-KUMAR-BARPANDA/synapse-framework
9
+ Project-URL: Issues, https://github.com/AKASH-KUMAR-BARPANDA/synapse-framework/issues
10
+ Keywords: mcp,rag,agents,knowledge-graph,fastapi,claude,cursor,ollama,chromadb,qdrant,networkx,ai
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
20
+ Requires-Python: >=3.10
21
+ Description-Content-Type: text/markdown
22
+ License-File: LICENSE
23
+ Requires-Dist: chromadb>=1.5.9
24
+ Requires-Dist: fastapi[standard]>=0.142.2
25
+ Requires-Dist: fastembed>=0.8.1
26
+ Requires-Dist: google-api-python-client>=2.201.0
27
+ Requires-Dist: google-auth-httplib2>=0.4.4
28
+ Requires-Dist: google-auth-oauthlib>=1.5.0
29
+ Requires-Dist: httpx>=0.28.1
30
+ Requires-Dist: langchain>=1.4.3
31
+ Requires-Dist: langchain-chroma>=1.1.0
32
+ Requires-Dist: langchain-community>=0.4.2
33
+ Requires-Dist: langchain-core>=1.6.7
34
+ Requires-Dist: langchain-ollama>=1.1.0
35
+ Requires-Dist: matplotlib>=3.11.2
36
+ Requires-Dist: mcp>=2.3.0
37
+ Requires-Dist: networkx>=3.7
38
+ Requires-Dist: pydantic>=2.13.5
39
+ Requires-Dist: uvicorn>=0.30.0
40
+ Provides-Extra: qdrant
41
+ Requires-Dist: qdrant-client>=1.12.0; extra == "qdrant"
42
+ Provides-Extra: all
43
+ Requires-Dist: qdrant-client>=1.12.0; extra == "all"
44
+ Provides-Extra: dev
45
+ Requires-Dist: bandit>=1.9.0; extra == "dev"
46
+ Requires-Dist: build>=1.2.0; extra == "dev"
47
+ Requires-Dist: pip-audit>=2.8.0; extra == "dev"
48
+ Requires-Dist: pytest>=8.0.0; extra == "dev"
49
+ Requires-Dist: twine>=6.0.0; extra == "dev"
50
+ Dynamic: license-file
51
+
52
+ <p align="center">
53
+ <img src="assets/logo.png" width="160" height="160" alt="Synapse Logo" style="border-radius: 36px; box-shadow: 0 12px 36px rgba(0,0,0,0.4);"/>
54
+ </p>
55
+
56
+ <h1 align="center">Synapse</h1>
57
+
58
+ <p align="center">
59
+ <b>Modular Multi-MCP & Hybrid RAG AI Application Framework</b>
60
+ </p>
61
+
62
+ <p align="center">
63
+ <a href="https://pypi.org/project/synapse-framework/"><img src="https://img.shields.io/pypi/v/synapse-framework.svg?color=6366F1&label=PyPI" alt="PyPI version"/></a>
64
+ <a href="https://pypi.org/project/synapse-framework/"><img src="https://img.shields.io/pypi/pyversions/synapse-framework.svg?color=06B6D4" alt="Python Versions"/></a>
65
+ <a href="https://github.com/AKASH-KUMAR-BARPANDA/synapse-framework/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="License: MIT"/></a>
66
+ <a href="https://github.com/AKASH-KUMAR-BARPANDA/synapse-framework/actions"><img src="https://img.shields.io/badge/tests-23%20passing-success.svg?color=10B981" alt="Tests"/></a>
67
+ <a href="https://github.com/PyCQA/bandit"><img src="https://img.shields.io/badge/security-bandit%20passed-success.svg?color=10B981" alt="Bandit Security"/></a>
68
+ </p>
69
+
70
+ <p align="center">
71
+ <a href="#-quickstart">Quickstart</a> β€’
72
+ <a href="#-key-features">Features</a> β€’
73
+ <a href="#-interactive-inspector--3d-graph">Inspector & Graph</a> β€’
74
+ <a href="#-core-architecture">Architecture</a> β€’
75
+ <a href="#-api-endpoint-reference">API Endpoints</a> β€’
76
+ <a href="#-claude-desktop--cursor-export">MCP Export</a> β€’
77
+ <a href="#-license">License</a>
78
+ </p>
79
+
80
+ ---
81
+
82
+ **Synapse** is an open-source, local-first Python framework for developing autonomous AI assistants, multi-tool agents, and intelligent backend services. It unifies **Model Context Protocol (MCP)** tool execution, **Hybrid RAG** (vector embeddings combined with directed knowledge graphs), pluggable inference providers (**Ollama**, **Google Gemini**, **OpenAI**), and a real-time developer inspector with an interactive 3D WebGL knowledge visualizer.
83
+
84
+ ---
85
+
86
+ ## ⚑ Key Features
87
+
88
+ - πŸ”Œ **Dynamic Multi-MCP Tool Orchestration** β€” Aggregate custom Python functions, external FastMCP servers, and cloud services into schema-validated, discoverable tool sets with automatic LLM tool routing.
89
+ - πŸ•ΈοΈ **Hybrid RAG (Vector + Knowledge Graph)** β€” Dual-channel retrieval engine pairing semantic vector search (ChromaDB, Qdrant, FastEmbed) with relation-aware multi-hop graph queries (NetworkX, Neo4j).
90
+ - 🧠 **Model Agnostic Inference** β€” Native support for offline local LLMs via **Ollama** (Qwen 2.5, Llama 3, Mistral) and frontier cloud models (**Google Gemini**, **OpenAI**, Groq, vLLM) with zero lock-in.
91
+ - πŸ“Š **Real-Time Interactive Inspector** β€” Built-in dashboard at `/inspector` to test prompts, monitor live tool execution traces, inspect retrieved vector chunks, and explore relation facts.
92
+ - 🌐 **3D WebGL Knowledge Graph** β€” Standalone interactive visualizer at `/graph/export` featuring physics simulations, entity clustering, and real-time relation navigation.
93
+ - πŸ“¦ **One-Click MCP Server Export** β€” Expose your application's tools to Claude Desktop, Cursor, or LibreChat with `synapse export-mcp`.
94
+ - πŸ›‘οΈ **Zero Vulnerabilities & High Test Coverage** β€” Clean 100% Bandit security audit, full type annotations, and modern Python 3.10+ async architecture.
95
+
96
+ ---
97
+
98
+ ## πŸ“Έ Interactive Inspector & 3D Graph
99
+
100
+ ### 1. Developer Inspector Dashboard (`/inspector`)
101
+ Test chat prompts, observe schema-validated tool invocations in real time, and audit retrieved vector chunks and knowledge graph triples side-by-side:
102
+
103
+ <p align="center">
104
+ <img src="assets/inspector_preview.png" width="100%" alt="Synapse Inspector Dashboard" style="border-radius: 12px; border: 1px solid #27272a; box-shadow: 0 8px 24px rgba(0,0,0,0.5);"/>
105
+ </p>
106
+
107
+ ### 2. 3D WebGL Knowledge Graph Explorer (`/graph/export`)
108
+ Navigate and visualize complex entity relationships and multi-hop triples in an interactive 3D physics-based canvas:
109
+
110
+ <p align="center">
111
+ <img src="assets/graph_preview.png" width="100%" alt="Synapse 3D Knowledge Graph" style="border-radius: 12px; border: 1px solid #27272a; box-shadow: 0 8px 24px rgba(0,0,0,0.5);"/>
112
+ </p>
113
+
114
+ ### 3. Connector & Sync Manager (`/connectors`)
115
+ Audit connected tools, check authentication status, and trigger on-demand synchronization:
116
+
117
+ <p align="center">
118
+ <img src="assets/connectors_preview.png" width="100%" alt="Synapse Connectors View" style="border-radius: 12px; border: 1px solid #27272a; box-shadow: 0 8px 24px rgba(0,0,0,0.5);"/>
119
+ </p>
120
+
121
+ ### 4. Interactive OpenAPI & Swagger Endpoints (`/docs`)
122
+ Explore and test all REST routes, SSE streams, sync triggers, and MCP export endpoints in real time:
123
+
124
+ <p align="center">
125
+ <img src="assets/openapi_preview.png" width="100%" alt="Synapse OpenAPI Docs" style="border-radius: 12px; border: 1px solid #27272a; box-shadow: 0 8px 24px rgba(0,0,0,0.5);"/>
126
+ </p>
127
+
128
+ ---
129
+
130
+ ## πŸ—οΈ Core Architecture
131
+
132
+ ```mermaid
133
+ flowchart TD
134
+ subgraph Clients ["Clients & Interfaces"]
135
+ UI["Web Inspector (/inspector)"]
136
+ CLI["Cursor / Claude Desktop (MCP)"]
137
+ API["REST & SSE Endpoints (/chat)"]
138
+ end
139
+
140
+ subgraph Core ["Synapse BaseApp Engine"]
141
+ Router["FastAPI Application"]
142
+ Dispatcher["Tool & Skill Dispatcher"]
143
+ Context["Execution Tracer"]
144
+ end
145
+
146
+ subgraph LLM ["Model Providers"]
147
+ OLL["Ollama (Qwen, Llama 3)"]
148
+ GEM["Google Gemini 1.5 / 2.0"]
149
+ OAI["OpenAI (GPT-4o, mini)"]
150
+ end
151
+
152
+ subgraph Storage ["Hybrid RAG & Memory"]
153
+ Vec["Vector Store (ChromaDB / Qdrant)"]
154
+ Graph["Knowledge Graph (NetworkX / Neo4j)"]
155
+ Emb["Local Embeddings (FastEmbed / BGE)"]
156
+ end
157
+
158
+ subgraph Tools ["Multi-MCP Connectors"]
159
+ F1["Custom Tools (makeconnectors)"]
160
+ F2["OAuth Connectors (Gmail, Notion, Photos)"]
161
+ F3["External FastMCP Servers"]
162
+ end
163
+
164
+ UI --> Router
165
+ CLI --> Router
166
+ API --> Router
167
+
168
+ Router --> Dispatcher
169
+ Dispatcher <--> LLM
170
+ Dispatcher <--> Storage
171
+ Dispatcher <--> Tools
172
+ Dispatcher --> Context
173
+ ```
174
+
175
+ ---
176
+
177
+ ## πŸ“¦ Installation
178
+
179
+ Install `synapse-framework` using pip:
180
+
181
+ ```bash
182
+ pip install synapse-framework
183
+ ```
184
+
185
+ Or using `uv`:
186
+
187
+ ```bash
188
+ uv add synapse-framework
189
+ ```
190
+
191
+ ### Optional Extras
192
+
193
+ ```bash
194
+ # Add Qdrant vector database support
195
+ pip install "synapse-framework[qdrant]"
196
+
197
+ # Install all optional drivers and dependencies
198
+ pip install "synapse-framework[all]"
199
+ ```
200
+
201
+ ---
202
+
203
+ ## πŸš€ 60-Second Quickstart
204
+
205
+ Create an intelligent assistant with custom Python tools, local Ollama inference, and a live web inspector in under 25 lines of code:
206
+
207
+ ```python
208
+ from typing import Dict, Any
209
+ from synapse import BaseApp
210
+ from synapse.models import Ollama
211
+ from synapse.connectors import makeconnectors
212
+
213
+ # 1. Define custom tools with clear docstrings
214
+ def search_product_catalog(query: str, category: str = "all") -> Dict[str, Any]:
215
+ """Searches the product database and inventory across warehouses."""
216
+ return {"results": [{"id": "SKU-992", "name": "Neuro-Link Adapter", "price": 149.0, "stock": 42}]}
217
+
218
+ def calculate_shipping(weight_kg: float, international: bool = False) -> Dict[str, Any]:
219
+ """Calculates shipping cost based on package weight and destination."""
220
+ rate = 14.5 if international else 5.5
221
+ return {"cost_usd": round(weight_kg * rate, 2), "carrier": "Express Air"}
222
+
223
+ # 2. Package tools into an MCP connector
224
+ inventory_connector = makeconnectors(
225
+ name="inventory_service",
226
+ tools=[search_product_catalog, calculate_shipping],
227
+ )
228
+
229
+ # 3. Initialize Synapse application
230
+ app = BaseApp(
231
+ title="Logistics Assistant",
232
+ model=Ollama(model="qwen2.5:0.5b", base_url="http://localhost:11434"),
233
+ connectors=[inventory_connector],
234
+ visualize_graph=True,
235
+ )
236
+
237
+ if __name__ == "__main__":
238
+ app.run(host="127.0.0.1", port=8000)
239
+ ```
240
+
241
+ Open your browser to start interacting:
242
+ - πŸ“Š **Web Inspector**: [`http://127.0.0.1:8000/inspector`](http://127.0.0.1:8000/inspector)
243
+ - πŸ•ΈοΈ **3D Knowledge Graph**: [`http://127.0.0.1:8000/graph/export`](http://127.0.0.1:8000/graph/export)
244
+ - πŸ“– **Interactive OpenAPI Docs**: [`http://127.0.0.1:8000/docs`](http://127.0.0.1:8000/docs)
245
+
246
+ ---
247
+
248
+ ## 🧠 Pluggable Model Providers
249
+
250
+ Synapse offers unified model abstractions with automatic prompt formatting and tool calling normalization:
251
+
252
+ ### 1. Local Ollama (Offline / Private)
253
+ ```python
254
+ from synapse.models import Ollama
255
+
256
+ model = Ollama(
257
+ model="qwen2.5:0.5b",
258
+ base_url="http://localhost:11434",
259
+ temperature=0.2,
260
+ )
261
+ ```
262
+
263
+ ### 2. Google Gemini
264
+ ```python
265
+ import os
266
+ from synapse.models import Gemini
267
+
268
+ model = Gemini(
269
+ api_key=os.getenv("GEMINI_API_KEY"),
270
+ model="gemini-1.5-flash",
271
+ )
272
+ ```
273
+
274
+ ### 3. OpenAI / Groq / OpenRouter / vLLM
275
+ ```python
276
+ import os
277
+ from synapse.models import OpenAI
278
+
279
+ model = OpenAI(
280
+ api_key=os.getenv("OPENAI_API_KEY"),
281
+ model="gpt-4o-mini",
282
+ )
283
+ ```
284
+
285
+ ---
286
+
287
+ ## πŸ”Œ Connectors & Custom Tools
288
+
289
+ ### Custom Tools via `makeconnectors`
290
+ Transform any Python functions into a tool connector ready for MCP client consumption:
291
+
292
+ ```python
293
+ from synapse.connectors import makeconnectors
294
+
295
+ def query_financial_metrics(quarter: str = "Q3") -> dict:
296
+ """Returns quarterly revenue, operating expenses, and net profit margin."""
297
+ return {"revenue": 420000, "expenses": 180000, "margin": "57.1%"}
298
+
299
+ finance_connector = makeconnectors(
300
+ name="finance_analytics",
301
+ tools=[query_financial_metrics],
302
+ )
303
+ ```
304
+
305
+ ### Prebuilt OAuth Productivity Connectors
306
+ Synapse includes managed OAuth 2.0 lifecycle helpers:
307
+
308
+ ```python
309
+ from synapse.oauth import GoogleOAuthService
310
+ from synapse.connectors import GmailConnectors, GooglePhotosConnectors, NotionConnectors
311
+
312
+ oauth = GoogleOAuthService(
313
+ credentials_path="credentials.json",
314
+ token_path="token.json",
315
+ )
316
+
317
+ gmail = GmailConnectors(oauth_service=oauth)
318
+ photos = GooglePhotosConnectors(oauth_service=oauth)
319
+ notion = NotionConnectors(api_key="secret_notion_key")
320
+ ```
321
+
322
+ ---
323
+
324
+ ## πŸ•ΈοΈ Hybrid RAG & Knowledge Graph
325
+
326
+ Synapse pairs dense semantic similarity with relational graph reasoning:
327
+
328
+ ```python
329
+ from synapse.storage import PersistentGraphStore, VectorStore
330
+ from synapse.rag import HybridRAG
331
+
332
+ # 1. Initialize persistent storage layers
333
+ graph_store = PersistentGraphStore(filepath="./data/graph.json")
334
+ vector_store = VectorStore(persist_dir="./data/chroma_db")
335
+
336
+ # 2. Add relational facts to knowledge graph
337
+ graph_store.add_relation("Alice", "LEADS", "Platform Engineering", source_type="Person", target_type="Organization")
338
+ graph_store.add_relation("Platform Engineering", "MAINTAINS", "Synapse Framework", source_type="Organization", target_type="Project")
339
+
340
+ # 3. Query combined knowledge base
341
+ rag = HybridRAG(vector_store=vector_store, graph_store=graph_store)
342
+ result = rag.retrieve_context("What does Alice lead?")
343
+
344
+ print("Entities found:", result["entities_detected"])
345
+ print("Graph facts:", result["graph_facts"])
346
+ ```
347
+
348
+ ---
349
+
350
+ ## 🌐 API Endpoint Reference
351
+
352
+ Synapse automatically mounts standard REST, Server-Sent Events (SSE), and documentation endpoints on your application:
353
+
354
+ | Method | Endpoint | Tag | Description |
355
+ | :--- | :--- | :--- | :--- |
356
+ | `GET` | **`/`** or **`/inspector`** | `Inspector` | Interactive Web Inspector dashboard for chat, trace inspection, and tools. |
357
+ | `POST` | **`/chat`** | `Chat` | Server-Sent Events (SSE) streaming endpoint for agent prompts, tool calls, and grounded replies. |
358
+ | `GET` | **`/graph/export`** | `Graph` | Full-screen interactive 3D WebGL knowledge graph visualizer. |
359
+ | `GET` | **`/graph/data`** | `Graph` | JSON payload containing all graph nodes, directed links, color tokens, and stats. |
360
+ | `GET` | **`/connectors`** | `Sync` | Lists all registered connectors, descriptions, and active tools. |
361
+ | `POST` | **`/sync/{connector_name}`** | `Sync` | Triggers background synchronization and indexing for a specific connector. |
362
+ | `GET` | **`/sync/status`** | `Sync` | Returns current synchronization progress, item counts, and timestamps. |
363
+ | `GET` | **`/mcp/export`** | `MCP` | Exports active tools into Claude Desktop config format and FastMCP manifests. |
364
+ | `GET` | **`/skills`** | `Skills` | Returns registered agent skills and specialized system instructions. |
365
+ | `GET` | **`/resources`** | `Resources` | Lists static reference documents and indexed data resources. |
366
+ | `GET` | **`/info`** | `Inspector` | Overview of running model provider, connector count, and framework version. |
367
+ | `GET` | **`/health`** | `System` | Health check endpoint returning status and uptime. |
368
+ | `GET` | **`/docs`** | `Docs` | Interactive Swagger / OpenAPI documentation with try-it-out capabilities. |
369
+
370
+ ---
371
+
372
+ ## πŸ› οΈ Claude Desktop & Cursor Export
373
+
374
+ Export your application tools directly to Claude Desktop or Cursor:
375
+
376
+ ```bash
377
+ # Export config file
378
+ synapse export-mcp --output claude_desktop_config.json
379
+ ```
380
+
381
+ Add the configuration block into your `claude_desktop_config.json`:
382
+
383
+ ```json
384
+ {
385
+ "mcpServers": {
386
+ "synapse": {
387
+ "command": "python",
388
+ "args": ["-m", "synapse.export.mcp_server", "--port", "8000"]
389
+ }
390
+ }
391
+ }
392
+ ```
393
+
394
+ ---
395
+
396
+ ## πŸ§ͺ Testing & Code Quality
397
+
398
+ Synapse is built with strict code quality and security verification:
399
+
400
+ ```bash
401
+ # Run pytest test suite (23 unit tests)
402
+ pytest tests/
403
+
404
+ # Run security static analysis (0 vulnerabilities)
405
+ bandit -r synapse
406
+
407
+ # Check code formatting and modern standards
408
+ ruff check synapse/
409
+ ```
410
+
411
+ ---
412
+
413
+ ## πŸ“„ License
414
+
415
+ Synapse is licensed under the [MIT License](LICENSE).