concierge-graph 3.8.2__tar.gz → 4.1.0__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 (103) hide show
  1. concierge_graph-4.1.0/PKG-INFO +210 -0
  2. concierge_graph-4.1.0/README.md +158 -0
  3. concierge_graph-4.1.0/concierge_graph.egg-info/PKG-INFO +210 -0
  4. concierge_graph-4.1.0/concierge_graph.egg-info/SOURCES.txt +89 -0
  5. concierge_graph-4.1.0/concierge_graph.egg-info/requires.txt +31 -0
  6. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/concierge_graph.egg-info/top_level.txt +0 -1
  7. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/core/__init__.py +1 -1
  8. concierge_graph-4.1.0/core/checkpointer.py +267 -0
  9. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/core/config.py +3 -26
  10. concierge_graph-4.1.0/core/database.py +66 -0
  11. concierge_graph-4.1.0/core/graph_rag.py +201 -0
  12. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/core/hybrid_search.py +29 -41
  13. concierge_graph-4.1.0/core/mcp_governor.py +215 -0
  14. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/core/memory_extractor.py +2 -2
  15. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/core/middleware.py +84 -41
  16. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/core/project_index.py +8 -102
  17. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/core/vector_backend.py +4 -4
  18. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/ingestion/crawler.py +4 -4
  19. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/ingestion/orchestrator.py +201 -23
  20. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/ingestion/parser.py +3 -3
  21. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/ingestion/summarizer.py +204 -110
  22. concierge_graph-4.1.0/interface/__init__.py +13 -0
  23. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/interface/cli.py +46 -3
  24. concierge_graph-4.1.0/interface/mcp_server.py +2013 -0
  25. concierge_graph-4.1.0/interface/queue_writer.py +304 -0
  26. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/main.py +487 -281
  27. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/pyproject.toml +113 -105
  28. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/scripts/bootstrap_core_memory.py +93 -93
  29. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/services/janitor.py +6 -33
  30. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/storage/connection.py +487 -309
  31. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/storage/logic.py +759 -703
  32. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/storage/schema.py +155 -14
  33. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/storage/store.py +854 -802
  34. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/storage/vector_store.py +47 -34
  35. concierge_graph-4.1.0/tests/test_agent_checkpointer.py +192 -0
  36. concierge_graph-4.1.0/tests/test_agent_checkpoints_schema.py +423 -0
  37. concierge_graph-4.1.0/tests/test_call_chain_edges_nodes.py +553 -0
  38. concierge_graph-4.1.0/tests/test_checkpoint_ownership.py +536 -0
  39. concierge_graph-4.1.0/tests/test_checkpointer_arg_resolution.py +280 -0
  40. concierge_graph-4.1.0/tests/test_checkpointer_live_contract.py +176 -0
  41. concierge_graph-4.1.0/tests/test_checkpointer_sdd20_removed.py +87 -0
  42. concierge_graph-4.1.0/tests/test_clean_database_schema.py +63 -0
  43. concierge_graph-4.1.0/tests/test_cli_mcp_entrypoint.py +215 -0
  44. concierge_graph-4.1.0/tests/test_concurrency_stress.py +139 -0
  45. concierge_graph-4.1.0/tests/test_config.py +202 -0
  46. concierge_graph-4.1.0/tests/test_connection_queue_resilience.py +572 -0
  47. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/tests/test_conversational_db.py +2 -2
  48. concierge_graph-4.1.0/tests/test_dependency_pins.py +173 -0
  49. concierge_graph-4.1.0/tests/test_docker_manifests.py +93 -0
  50. concierge_graph-4.1.0/tests/test_domain_neutrality_guard.py +269 -0
  51. concierge_graph-4.1.0/tests/test_env_example_provider.py +45 -0
  52. concierge_graph-4.1.0/tests/test_fts_atomic_migration.py +265 -0
  53. concierge_graph-4.1.0/tests/test_fts_code_search.py +533 -0
  54. concierge_graph-4.1.0/tests/test_governor_wiring.py +197 -0
  55. concierge_graph-4.1.0/tests/test_graph_rag_loops.py +139 -0
  56. concierge_graph-4.1.0/tests/test_hybrid_search_escolha_a.py +52 -0
  57. concierge_graph-4.1.0/tests/test_ingestion_embed_regression.py +231 -0
  58. concierge_graph-4.1.0/tests/test_ingestion_vector_repair.py +504 -0
  59. concierge_graph-4.1.0/tests/test_interface_contracts.py +467 -0
  60. concierge_graph-4.1.0/tests/test_lazy_ml_imports.py +188 -0
  61. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/tests/test_lightweight.py +2 -2
  62. concierge_graph-4.1.0/tests/test_llm_egress_guard.py +611 -0
  63. concierge_graph-4.1.0/tests/test_mcp_governor.py +222 -0
  64. concierge_graph-4.1.0/tests/test_mcp_security_governance.py +278 -0
  65. concierge_graph-4.1.0/tests/test_mcp_server_extensions.py +275 -0
  66. concierge_graph-4.1.0/tests/test_mcp_server_handlers.py +505 -0
  67. concierge_graph-4.1.0/tests/test_no_secrets_in_tracked_files.py +42 -0
  68. concierge_graph-4.1.0/tests/test_project_index.py +27 -0
  69. concierge_graph-4.1.0/tests/test_queue_writer_batching.py +100 -0
  70. concierge_graph-4.1.0/tests/test_queue_writer_resilience.py +472 -0
  71. concierge_graph-4.1.0/tests/test_secret_redaction.py +310 -0
  72. concierge_graph-4.1.0/tests/test_semantic_facts_utility.py +55 -0
  73. concierge_graph-4.1.0/tests/test_sse_auth_hardening.py +199 -0
  74. concierge_graph-4.1.0/tests/test_stdin_decouple.py +209 -0
  75. concierge_graph-4.1.0/tests/test_storage_logic.py +869 -0
  76. concierge_graph-4.1.0/tests/test_stress_components_reuse.py +128 -0
  77. concierge_graph-4.1.0/tests/test_summary_persistence.py +181 -0
  78. concierge_graph-4.1.0/tests/test_wheel_integrity.py +183 -0
  79. concierge_graph-3.8.2/PKG-INFO +0 -327
  80. concierge_graph-3.8.2/README.md +0 -261
  81. concierge_graph-3.8.2/agents/__init__.py +0 -14
  82. concierge_graph-3.8.2/agents/revisor_critico.py +0 -610
  83. concierge_graph-3.8.2/concierge_graph.egg-info/PKG-INFO +0 -327
  84. concierge_graph-3.8.2/concierge_graph.egg-info/SOURCES.txt +0 -47
  85. concierge_graph-3.8.2/concierge_graph.egg-info/requires.txt +0 -20
  86. concierge_graph-3.8.2/core/probabilistic_retriever.py +0 -99
  87. concierge_graph-3.8.2/interface/__init__.py +0 -16
  88. concierge_graph-3.8.2/interface/action_hooks.py +0 -261
  89. concierge_graph-3.8.2/interface/mcp_server.py +0 -1737
  90. concierge_graph-3.8.2/tests/test_probabilistic_retriever.py +0 -149
  91. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/LICENSE +0 -0
  92. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/concierge_graph.egg-info/dependency_links.txt +0 -0
  93. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/concierge_graph.egg-info/entry_points.txt +0 -0
  94. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/ingestion/__init__.py +0 -0
  95. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/services/__init__.py +0 -0
  96. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/setup.cfg +0 -0
  97. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/storage/__init__.py +0 -0
  98. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/storage/base_backend.py +0 -0
  99. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/storage/semantic_logic.py +0 -0
  100. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/tests/test_chunk_cache.py +0 -0
  101. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/tests/test_extraction_noop.py +0 -0
  102. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/tests/test_ignore.py +0 -0
  103. {concierge_graph-3.8.2 → concierge_graph-4.1.0}/tests/test_topology.py +0 -0
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: concierge-graph
3
+ Version: 4.1.0
4
+ Summary: Long-Term Memory (LTM) Palace for AI Agents — hybrid search, semantic graphs, and MCP tools for Cursor, Claude Desktop, and autonomous agents.
5
+ Author: LuisinTheLegend
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/LuisinTheLegend/ConciergeGraph
8
+ Project-URL: Repository, https://github.com/LuisinTheLegend/ConciergeGraph
9
+ Project-URL: Issues, https://github.com/LuisinTheLegend/ConciergeGraph/issues
10
+ Keywords: mcp,memory,graph,ai-agents,rag,semantic-search,vector-database,llm,cursor,claude-desktop,embeddings
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: chromadb>=1.0
26
+ Requires-Dist: mcp<2,>=1.27
27
+ Requires-Dist: sentence-transformers>=3.0
28
+ Requires-Dist: python-dotenv>=1.0
29
+ Requires-Dist: starlette>=0.36
30
+ Provides-Extra: gemini
31
+ Requires-Dist: google-genai>=0.1.0; extra == "gemini"
32
+ Provides-Extra: qdrant
33
+ Requires-Dist: qdrant-client>=1.7; extra == "qdrant"
34
+ Provides-Extra: openai
35
+ Requires-Dist: openai>=1.0; extra == "openai"
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=7.0; extra == "dev"
38
+ Requires-Dist: pytest-timeout>=2.2.0; extra == "dev"
39
+ Requires-Dist: flake8>=6.0; extra == "dev"
40
+ Requires-Dist: mypy>=1.0; extra == "dev"
41
+ Requires-Dist: rich>=13.0; extra == "dev"
42
+ Requires-Dist: packaging>=21.0; extra == "dev"
43
+ Requires-Dist: setuptools>=77.0.0; extra == "dev"
44
+ Requires-Dist: qdrant-client>=1.7; extra == "dev"
45
+ Requires-Dist: google-genai>=0.1.0; extra == "dev"
46
+ Requires-Dist: openai>=1.0; extra == "dev"
47
+ Provides-Extra: all
48
+ Requires-Dist: qdrant-client>=1.7; extra == "all"
49
+ Requires-Dist: google-genai>=0.1.0; extra == "all"
50
+ Requires-Dist: openai>=1.0; extra == "all"
51
+ Dynamic: license-file
52
+
53
+ English · [Português (Brasil)](README.pt-BR.md)
54
+ ---
55
+
56
+ # Concierge Graph (V4 Core)
57
+
58
+ **Open-Source, Local-First Long-Term Memory (LTM), Hybrid Search & MCP Governance Server for AI Agents and IDEs**
59
+
60
+ [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
61
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)
62
+ [![Protocol MCP](https://img.shields.io/badge/Protocol-MCP-purple.svg)](https://modelcontextprotocol.io/)
63
+ [![MCP Tools](https://img.shields.io/badge/MCP%20Tools-31-blue.svg)](docs-grafo-concierge/README.md)
64
+ [![Tests Passing](https://img.shields.io/badge/Tests-369%20Passed-brightgreen.svg)](tests/)
65
+
66
+ Concierge Graph is a local-first memory server built around the **Model Context Protocol (MCP)** that gives AI coding assistants (Cursor, Claude Desktop, and autonomous agents) persistent project memory, hybrid retrieval, recursive call-chain queries, durable agent checkpoints, and governed tool disclosure — backed by **SQLite WAL (with FTS5)** and pluggable vector storage (**ChromaDB** by default, optional **Qdrant**).
67
+
68
+ > **V4 Core Consolidation Note:** Experimental modules from earlier iterations have been moved to quarantine under [`archive/v4-experimental/`](archive/v4-experimental/) so that the active V4 core remains lean, deterministic, and audited.
69
+
70
+ ---
71
+
72
+ ## Core Capabilities (V4 Core)
73
+
74
+ 1. **SQLite WAL + FTS5 Relational Graph (`storage/`)**: Stores projects, code nodes, call/import edges, semantic facts, memory commits, and durable agent checkpoints (`agent_checkpoints`) in a local SQLite database with WAL mode and full-text indexing.
75
+ 2. **Tri-Signal Hybrid Search v4 (`core/hybrid_search.py`)**: Blends dense vector similarity (`sentence-transformers` + ChromaDB/Qdrant), SQLite FTS5 BM25 lexical scoring, and topological/recency signals with strict project/wing scoping and query-time orphan vector filtering.
76
+ 3. **Python AST Ingestion & Self-Healing Vectors (`ingestion/`, `services/janitor.py`)**: Crawls repositories, extracts Python AST chunks and call edges, repairs missing embeddings during mining with honest failure reporting, and supports on-demand vector reconciliation (`concierge sync-vector`).
77
+ 4. **Recursive Call-Chain GraphRAG (`core/graph_rag.py`)**: Traverses multi-hop `calls` dependencies over SQLite `edges` using `WITH RECURSIVE` CTEs protected by strict pipe-delimited cycle guards (`|node|`).
78
+ 5. **Durable Agent Checkpoints with Ownership Binding (`core/checkpointer.py`)**: Persists and retrieves structured agent state dictionaries in `agent_checkpoints` via `agent_save_checkpoint`, `agent_get_checkpoint`, and `agent_list_checkpoints` with strict argument resolution, corrupt-JSON detection, and SHA-256 `owner_hash` namespace verification (`GRAFO_AGENT_TOKEN` over `stdio`, or `X-Grafo-Agent-Token` over HTTP/SSE decoupled from `Authorization: Bearer`, falling back to an ephemeral per-`ServerSession` secret).
79
+ 6. **Least-Privilege MCP Governance (`core/mcp_governor.py`)**: Classifies all **31 live MCP tools** into `READ_ONLY` (17), `LOCAL_MUTATION` (12), and `DANGEROUS` (2) across a 3-state hierarchy (`PLANNING < EXECUTION < MAINTENANCE`), defaulting to `PLANNING` (`GRAFO_DEFAULT_STATE`) as a hard privilege ceiling (`max_state`). Sessions are bound server-side to the MCP transport (`WeakKeyDictionary`), undeclared tool arguments are rejected, and both `list_tools` (`ListToolsRequest`) and runtime execution enforce fail-closed governance filtering.
80
+ 7. **Domain Neutrality & Free-Form Wings**: Project wings are strictly user- or agent-defined free-form strings — no hardcoded business taxonomies exist in product code, enforced by AST guard tests (`tests/test_domain_neutrality_guard.py`).
81
+ 8. **Optional Lightweight Mode & Optional LLM Summaries**: Set `GRAFO_LIGHTWEIGHT_MODE=true` to operate without heavy vector models using SQLite FTS5 BM25, and `GRAFO_LLM_MODEL=none` to run fully offline without external LLM calls.
82
+
83
+ ---
84
+
85
+ ## Architecture Overview
86
+
87
+ ```
88
+ ┌───────────────────────────┐ ┌───────────────────────────┐
89
+ │ Cursor / Windsurf │ │ Claude Desktop │
90
+ └─────────────┬─────────────┘ └─────────────┬─────────────┘
91
+ │ │
92
+ │ MCP (stdio default / SSE) │
93
+ └─────────────────┬────────────────┘
94
+ │
95
+ ▼
96
+ ┌─────────────────────────────┐ ┌─────────────────────┐
97
+ │ Concierge Graph MCP Server │ │ concierge CLI │
98
+ │ concierge-mcp (Port 8000) │ │ (10 subcommands) │
99
+ └──────────────┬──────────────┘ └──────────┬──────────┘
100
+ │ │
101
+ └───────────────┬────────────────┘
102
+ ▼
103
+ ┌──────────────────────────────┐
104
+ │ GrafoConcierge Facade │
105
+ │ + MCPToolGovernor (31) │
106
+ └──────────────┬───────────────┘
107
+ ▼
108
+ ┌──────────────────────────────┐
109
+ │ SQLite WAL/FTS5 + ChromaDB │
110
+ │ (or optional Qdrant) │
111
+ └──────────────────────────────┘
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Quick Start
117
+
118
+ ### Quick Install (`v4.1.0`)
119
+
120
+ > **Release & PyPI Status:** Version `4.1.0` supersedes the legacy `v3.8.2` release on PyPI and the pre-audit `V4.0.0` GitHub tag (kept intact in repository history).
121
+
122
+ 1. **Install via pip (or from source in editable mode):**
123
+ ```bash
124
+ # Package installation:
125
+ pip install concierge-graph
126
+
127
+ # Or editable source checkout:
128
+ git clone https://github.com/LuisinTheLegend/ConciergeGraph.git
129
+ cd ConciergeGraph
130
+ python -m venv .venv
131
+ # Linux / macOS: source .venv/bin/activate
132
+ # Windows PowerShell: .venv\Scripts\Activate.ps1
133
+ pip install --upgrade pip
134
+ pip install -e .
135
+ ```
136
+ For development and running tests (or install via `pip install -r requirements-dev.txt`; `requirements.txt` contains production runtime packages only):
137
+ ```bash
138
+ pip install -e ".[dev]"
139
+ ```
140
+
141
+ 2. **Configure environment variables (`.env`):**
142
+ ```bash
143
+ cp .env.example .env
144
+ ```
145
+ Minimal local-first configuration (LLM disabled by default if not needed):
146
+ ```env
147
+ GRAFO_LLM_MODEL=none
148
+ GRAFO_TRANSPORT=stdio
149
+ GRAFO_DB_PATH=./data/concierge.db
150
+ GRAFO_CHROMA_PATH=./data/chroma
151
+ ```
152
+ To run over HTTP/SSE instead of `stdio`:
153
+ ```env
154
+ GRAFO_TRANSPORT=sse
155
+ GRAFO_HOST=127.0.0.1
156
+ GRAFO_PORT=8000
157
+ GRAFO_API_KEY=your_optional_bearer_token
158
+ ```
159
+
160
+ 3. **Run the MCP Server or CLI:**
161
+ ```bash
162
+ # Launch MCP server (uses GRAFO_TRANSPORT: stdio default, or sse on port 8000)
163
+ concierge-mcp --help
164
+ concierge-mcp --version
165
+ concierge-mcp --transport sse
166
+
167
+ # Or start via Docker Compose (non-root UID 10001, SSE + /health check)
168
+ docker compose up -d --build
169
+
170
+ # Use the terminal CLI (10 subcommands)
171
+ concierge --help
172
+ concierge register --name my-project --wing backend/core
173
+ concierge mine --path /path/to/my-project --name my-project
174
+ concierge search --query "authentication flow" --project <project-uuid>
175
+ ```
176
+ When running over HTTP/SSE, `GET /health` and `HEAD /health` return `200 {"status": "ok"}` without requiring `GRAFO_API_KEY`, while `/sse`, `/messages/`, and all other paths remain protected by pure ASGI `Authorization: Bearer` validation.
177
+
178
+ ---
179
+
180
+ ## MCP Tools (31 Live Tools)
181
+
182
+ | Category | Count | Tools |
183
+ | :--- | :---: | :--- |
184
+ | **`READ_ONLY`** | 17 | `concierge_search`, `concierge_resume`, `concierge_load`, `concierge_status`, `concierge_list_projects`, `concierge_list_facts`, `concierge_get_memory`, `get_full_topology`, `get_trajectories`, `find_similar`, `search_symbols`, `get_implementations`, `get_callers`, `concierge_get_call_chain`, `count_embeddings`, `agent_get_checkpoint`, `agent_list_checkpoints` |
185
+ | **`LOCAL_MUTATION`** | 12 | `concierge_register`, `concierge_mine`, `concierge_commit`, `concierge_set_state`, `concierge_wakeup`, `concierge_store_fact`, `concierge_set_memory`, `concierge_feedback`, `update_project`, `add_reference_wing`, `remove_reference_wing`, `agent_save_checkpoint` |
186
+ | **`DANGEROUS`** | 2 | `delete_project`, `reset_collection` |
187
+
188
+ See [`docs-grafo-concierge/README.md`](docs-grafo-concierge/README.md) for architecture details and the full list of CLI subcommands.
189
+
190
+ ---
191
+
192
+ ## Testing & Verification
193
+
194
+ The active V4 core is covered by **369 passing automated tests** (verified in normal and `--reverse` order, plus CI across Linux, Windows, and real container `docker-smoke`):
195
+
196
+ ```bash
197
+ python -m pytest tests/ -q
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Contributing & Lineage
203
+
204
+ - Read [`CONTRIBUTING.md`](CONTRIBUTING.md) for architectural pillars, testing rules, and MCP governance contracts.
205
+ - Read [`ATTRIBUTION_AND_LINEAGE.md`](ATTRIBUTION_AND_LINEAGE.md) for technical credits and the active vs. quarantined status matrix.
206
+ - Read [`CHANGELOG.md`](CHANGELOG.md) for recent changes and breaking-change migration notes.
207
+
208
+ ## License
209
+
210
+ Distributed under the MIT License. See [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,158 @@
1
+ English · [Português (Brasil)](README.pt-BR.md)
2
+ ---
3
+
4
+ # Concierge Graph (V4 Core)
5
+
6
+ **Open-Source, Local-First Long-Term Memory (LTM), Hybrid Search & MCP Governance Server for AI Agents and IDEs**
7
+
8
+ [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
9
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)
10
+ [![Protocol MCP](https://img.shields.io/badge/Protocol-MCP-purple.svg)](https://modelcontextprotocol.io/)
11
+ [![MCP Tools](https://img.shields.io/badge/MCP%20Tools-31-blue.svg)](docs-grafo-concierge/README.md)
12
+ [![Tests Passing](https://img.shields.io/badge/Tests-369%20Passed-brightgreen.svg)](tests/)
13
+
14
+ Concierge Graph is a local-first memory server built around the **Model Context Protocol (MCP)** that gives AI coding assistants (Cursor, Claude Desktop, and autonomous agents) persistent project memory, hybrid retrieval, recursive call-chain queries, durable agent checkpoints, and governed tool disclosure — backed by **SQLite WAL (with FTS5)** and pluggable vector storage (**ChromaDB** by default, optional **Qdrant**).
15
+
16
+ > **V4 Core Consolidation Note:** Experimental modules from earlier iterations have been moved to quarantine under [`archive/v4-experimental/`](archive/v4-experimental/) so that the active V4 core remains lean, deterministic, and audited.
17
+
18
+ ---
19
+
20
+ ## Core Capabilities (V4 Core)
21
+
22
+ 1. **SQLite WAL + FTS5 Relational Graph (`storage/`)**: Stores projects, code nodes, call/import edges, semantic facts, memory commits, and durable agent checkpoints (`agent_checkpoints`) in a local SQLite database with WAL mode and full-text indexing.
23
+ 2. **Tri-Signal Hybrid Search v4 (`core/hybrid_search.py`)**: Blends dense vector similarity (`sentence-transformers` + ChromaDB/Qdrant), SQLite FTS5 BM25 lexical scoring, and topological/recency signals with strict project/wing scoping and query-time orphan vector filtering.
24
+ 3. **Python AST Ingestion & Self-Healing Vectors (`ingestion/`, `services/janitor.py`)**: Crawls repositories, extracts Python AST chunks and call edges, repairs missing embeddings during mining with honest failure reporting, and supports on-demand vector reconciliation (`concierge sync-vector`).
25
+ 4. **Recursive Call-Chain GraphRAG (`core/graph_rag.py`)**: Traverses multi-hop `calls` dependencies over SQLite `edges` using `WITH RECURSIVE` CTEs protected by strict pipe-delimited cycle guards (`|node|`).
26
+ 5. **Durable Agent Checkpoints with Ownership Binding (`core/checkpointer.py`)**: Persists and retrieves structured agent state dictionaries in `agent_checkpoints` via `agent_save_checkpoint`, `agent_get_checkpoint`, and `agent_list_checkpoints` with strict argument resolution, corrupt-JSON detection, and SHA-256 `owner_hash` namespace verification (`GRAFO_AGENT_TOKEN` over `stdio`, or `X-Grafo-Agent-Token` over HTTP/SSE decoupled from `Authorization: Bearer`, falling back to an ephemeral per-`ServerSession` secret).
27
+ 6. **Least-Privilege MCP Governance (`core/mcp_governor.py`)**: Classifies all **31 live MCP tools** into `READ_ONLY` (17), `LOCAL_MUTATION` (12), and `DANGEROUS` (2) across a 3-state hierarchy (`PLANNING < EXECUTION < MAINTENANCE`), defaulting to `PLANNING` (`GRAFO_DEFAULT_STATE`) as a hard privilege ceiling (`max_state`). Sessions are bound server-side to the MCP transport (`WeakKeyDictionary`), undeclared tool arguments are rejected, and both `list_tools` (`ListToolsRequest`) and runtime execution enforce fail-closed governance filtering.
28
+ 7. **Domain Neutrality & Free-Form Wings**: Project wings are strictly user- or agent-defined free-form strings — no hardcoded business taxonomies exist in product code, enforced by AST guard tests (`tests/test_domain_neutrality_guard.py`).
29
+ 8. **Optional Lightweight Mode & Optional LLM Summaries**: Set `GRAFO_LIGHTWEIGHT_MODE=true` to operate without heavy vector models using SQLite FTS5 BM25, and `GRAFO_LLM_MODEL=none` to run fully offline without external LLM calls.
30
+
31
+ ---
32
+
33
+ ## Architecture Overview
34
+
35
+ ```
36
+ ┌───────────────────────────┐ ┌───────────────────────────┐
37
+ │ Cursor / Windsurf │ │ Claude Desktop │
38
+ └─────────────┬─────────────┘ └─────────────┬─────────────┘
39
+ │ │
40
+ │ MCP (stdio default / SSE) │
41
+ └─────────────────┬────────────────┘
42
+ │
43
+ ▼
44
+ ┌─────────────────────────────┐ ┌─────────────────────┐
45
+ │ Concierge Graph MCP Server │ │ concierge CLI │
46
+ │ concierge-mcp (Port 8000) │ │ (10 subcommands) │
47
+ └──────────────┬──────────────┘ └──────────┬──────────┘
48
+ │ │
49
+ └───────────────┬────────────────┘
50
+ ▼
51
+ ┌──────────────────────────────┐
52
+ │ GrafoConcierge Facade │
53
+ │ + MCPToolGovernor (31) │
54
+ └──────────────┬───────────────┘
55
+ ▼
56
+ ┌──────────────────────────────┐
57
+ │ SQLite WAL/FTS5 + ChromaDB │
58
+ │ (or optional Qdrant) │
59
+ └──────────────────────────────┘
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Quick Start
65
+
66
+ ### Quick Install (`v4.1.0`)
67
+
68
+ > **Release & PyPI Status:** Version `4.1.0` supersedes the legacy `v3.8.2` release on PyPI and the pre-audit `V4.0.0` GitHub tag (kept intact in repository history).
69
+
70
+ 1. **Install via pip (or from source in editable mode):**
71
+ ```bash
72
+ # Package installation:
73
+ pip install concierge-graph
74
+
75
+ # Or editable source checkout:
76
+ git clone https://github.com/LuisinTheLegend/ConciergeGraph.git
77
+ cd ConciergeGraph
78
+ python -m venv .venv
79
+ # Linux / macOS: source .venv/bin/activate
80
+ # Windows PowerShell: .venv\Scripts\Activate.ps1
81
+ pip install --upgrade pip
82
+ pip install -e .
83
+ ```
84
+ For development and running tests (or install via `pip install -r requirements-dev.txt`; `requirements.txt` contains production runtime packages only):
85
+ ```bash
86
+ pip install -e ".[dev]"
87
+ ```
88
+
89
+ 2. **Configure environment variables (`.env`):**
90
+ ```bash
91
+ cp .env.example .env
92
+ ```
93
+ Minimal local-first configuration (LLM disabled by default if not needed):
94
+ ```env
95
+ GRAFO_LLM_MODEL=none
96
+ GRAFO_TRANSPORT=stdio
97
+ GRAFO_DB_PATH=./data/concierge.db
98
+ GRAFO_CHROMA_PATH=./data/chroma
99
+ ```
100
+ To run over HTTP/SSE instead of `stdio`:
101
+ ```env
102
+ GRAFO_TRANSPORT=sse
103
+ GRAFO_HOST=127.0.0.1
104
+ GRAFO_PORT=8000
105
+ GRAFO_API_KEY=your_optional_bearer_token
106
+ ```
107
+
108
+ 3. **Run the MCP Server or CLI:**
109
+ ```bash
110
+ # Launch MCP server (uses GRAFO_TRANSPORT: stdio default, or sse on port 8000)
111
+ concierge-mcp --help
112
+ concierge-mcp --version
113
+ concierge-mcp --transport sse
114
+
115
+ # Or start via Docker Compose (non-root UID 10001, SSE + /health check)
116
+ docker compose up -d --build
117
+
118
+ # Use the terminal CLI (10 subcommands)
119
+ concierge --help
120
+ concierge register --name my-project --wing backend/core
121
+ concierge mine --path /path/to/my-project --name my-project
122
+ concierge search --query "authentication flow" --project <project-uuid>
123
+ ```
124
+ When running over HTTP/SSE, `GET /health` and `HEAD /health` return `200 {"status": "ok"}` without requiring `GRAFO_API_KEY`, while `/sse`, `/messages/`, and all other paths remain protected by pure ASGI `Authorization: Bearer` validation.
125
+
126
+ ---
127
+
128
+ ## MCP Tools (31 Live Tools)
129
+
130
+ | Category | Count | Tools |
131
+ | :--- | :---: | :--- |
132
+ | **`READ_ONLY`** | 17 | `concierge_search`, `concierge_resume`, `concierge_load`, `concierge_status`, `concierge_list_projects`, `concierge_list_facts`, `concierge_get_memory`, `get_full_topology`, `get_trajectories`, `find_similar`, `search_symbols`, `get_implementations`, `get_callers`, `concierge_get_call_chain`, `count_embeddings`, `agent_get_checkpoint`, `agent_list_checkpoints` |
133
+ | **`LOCAL_MUTATION`** | 12 | `concierge_register`, `concierge_mine`, `concierge_commit`, `concierge_set_state`, `concierge_wakeup`, `concierge_store_fact`, `concierge_set_memory`, `concierge_feedback`, `update_project`, `add_reference_wing`, `remove_reference_wing`, `agent_save_checkpoint` |
134
+ | **`DANGEROUS`** | 2 | `delete_project`, `reset_collection` |
135
+
136
+ See [`docs-grafo-concierge/README.md`](docs-grafo-concierge/README.md) for architecture details and the full list of CLI subcommands.
137
+
138
+ ---
139
+
140
+ ## Testing & Verification
141
+
142
+ The active V4 core is covered by **369 passing automated tests** (verified in normal and `--reverse` order, plus CI across Linux, Windows, and real container `docker-smoke`):
143
+
144
+ ```bash
145
+ python -m pytest tests/ -q
146
+ ```
147
+
148
+ ---
149
+
150
+ ## Contributing & Lineage
151
+
152
+ - Read [`CONTRIBUTING.md`](CONTRIBUTING.md) for architectural pillars, testing rules, and MCP governance contracts.
153
+ - Read [`ATTRIBUTION_AND_LINEAGE.md`](ATTRIBUTION_AND_LINEAGE.md) for technical credits and the active vs. quarantined status matrix.
154
+ - Read [`CHANGELOG.md`](CHANGELOG.md) for recent changes and breaking-change migration notes.
155
+
156
+ ## License
157
+
158
+ Distributed under the MIT License. See [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,210 @@
1
+ Metadata-Version: 2.4
2
+ Name: concierge-graph
3
+ Version: 4.1.0
4
+ Summary: Long-Term Memory (LTM) Palace for AI Agents — hybrid search, semantic graphs, and MCP tools for Cursor, Claude Desktop, and autonomous agents.
5
+ Author: LuisinTheLegend
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/LuisinTheLegend/ConciergeGraph
8
+ Project-URL: Repository, https://github.com/LuisinTheLegend/ConciergeGraph
9
+ Project-URL: Issues, https://github.com/LuisinTheLegend/ConciergeGraph/issues
10
+ Keywords: mcp,memory,graph,ai-agents,rag,semantic-search,vector-database,llm,cursor,claude-desktop,embeddings
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Classifier: Topic :: Software Development :: Libraries
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Requires-Python: >=3.10
23
+ Description-Content-Type: text/markdown
24
+ License-File: LICENSE
25
+ Requires-Dist: chromadb>=1.0
26
+ Requires-Dist: mcp<2,>=1.27
27
+ Requires-Dist: sentence-transformers>=3.0
28
+ Requires-Dist: python-dotenv>=1.0
29
+ Requires-Dist: starlette>=0.36
30
+ Provides-Extra: gemini
31
+ Requires-Dist: google-genai>=0.1.0; extra == "gemini"
32
+ Provides-Extra: qdrant
33
+ Requires-Dist: qdrant-client>=1.7; extra == "qdrant"
34
+ Provides-Extra: openai
35
+ Requires-Dist: openai>=1.0; extra == "openai"
36
+ Provides-Extra: dev
37
+ Requires-Dist: pytest>=7.0; extra == "dev"
38
+ Requires-Dist: pytest-timeout>=2.2.0; extra == "dev"
39
+ Requires-Dist: flake8>=6.0; extra == "dev"
40
+ Requires-Dist: mypy>=1.0; extra == "dev"
41
+ Requires-Dist: rich>=13.0; extra == "dev"
42
+ Requires-Dist: packaging>=21.0; extra == "dev"
43
+ Requires-Dist: setuptools>=77.0.0; extra == "dev"
44
+ Requires-Dist: qdrant-client>=1.7; extra == "dev"
45
+ Requires-Dist: google-genai>=0.1.0; extra == "dev"
46
+ Requires-Dist: openai>=1.0; extra == "dev"
47
+ Provides-Extra: all
48
+ Requires-Dist: qdrant-client>=1.7; extra == "all"
49
+ Requires-Dist: google-genai>=0.1.0; extra == "all"
50
+ Requires-Dist: openai>=1.0; extra == "all"
51
+ Dynamic: license-file
52
+
53
+ English · [Português (Brasil)](README.pt-BR.md)
54
+ ---
55
+
56
+ # Concierge Graph (V4 Core)
57
+
58
+ **Open-Source, Local-First Long-Term Memory (LTM), Hybrid Search & MCP Governance Server for AI Agents and IDEs**
59
+
60
+ [![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
61
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](pyproject.toml)
62
+ [![Protocol MCP](https://img.shields.io/badge/Protocol-MCP-purple.svg)](https://modelcontextprotocol.io/)
63
+ [![MCP Tools](https://img.shields.io/badge/MCP%20Tools-31-blue.svg)](docs-grafo-concierge/README.md)
64
+ [![Tests Passing](https://img.shields.io/badge/Tests-369%20Passed-brightgreen.svg)](tests/)
65
+
66
+ Concierge Graph is a local-first memory server built around the **Model Context Protocol (MCP)** that gives AI coding assistants (Cursor, Claude Desktop, and autonomous agents) persistent project memory, hybrid retrieval, recursive call-chain queries, durable agent checkpoints, and governed tool disclosure — backed by **SQLite WAL (with FTS5)** and pluggable vector storage (**ChromaDB** by default, optional **Qdrant**).
67
+
68
+ > **V4 Core Consolidation Note:** Experimental modules from earlier iterations have been moved to quarantine under [`archive/v4-experimental/`](archive/v4-experimental/) so that the active V4 core remains lean, deterministic, and audited.
69
+
70
+ ---
71
+
72
+ ## Core Capabilities (V4 Core)
73
+
74
+ 1. **SQLite WAL + FTS5 Relational Graph (`storage/`)**: Stores projects, code nodes, call/import edges, semantic facts, memory commits, and durable agent checkpoints (`agent_checkpoints`) in a local SQLite database with WAL mode and full-text indexing.
75
+ 2. **Tri-Signal Hybrid Search v4 (`core/hybrid_search.py`)**: Blends dense vector similarity (`sentence-transformers` + ChromaDB/Qdrant), SQLite FTS5 BM25 lexical scoring, and topological/recency signals with strict project/wing scoping and query-time orphan vector filtering.
76
+ 3. **Python AST Ingestion & Self-Healing Vectors (`ingestion/`, `services/janitor.py`)**: Crawls repositories, extracts Python AST chunks and call edges, repairs missing embeddings during mining with honest failure reporting, and supports on-demand vector reconciliation (`concierge sync-vector`).
77
+ 4. **Recursive Call-Chain GraphRAG (`core/graph_rag.py`)**: Traverses multi-hop `calls` dependencies over SQLite `edges` using `WITH RECURSIVE` CTEs protected by strict pipe-delimited cycle guards (`|node|`).
78
+ 5. **Durable Agent Checkpoints with Ownership Binding (`core/checkpointer.py`)**: Persists and retrieves structured agent state dictionaries in `agent_checkpoints` via `agent_save_checkpoint`, `agent_get_checkpoint`, and `agent_list_checkpoints` with strict argument resolution, corrupt-JSON detection, and SHA-256 `owner_hash` namespace verification (`GRAFO_AGENT_TOKEN` over `stdio`, or `X-Grafo-Agent-Token` over HTTP/SSE decoupled from `Authorization: Bearer`, falling back to an ephemeral per-`ServerSession` secret).
79
+ 6. **Least-Privilege MCP Governance (`core/mcp_governor.py`)**: Classifies all **31 live MCP tools** into `READ_ONLY` (17), `LOCAL_MUTATION` (12), and `DANGEROUS` (2) across a 3-state hierarchy (`PLANNING < EXECUTION < MAINTENANCE`), defaulting to `PLANNING` (`GRAFO_DEFAULT_STATE`) as a hard privilege ceiling (`max_state`). Sessions are bound server-side to the MCP transport (`WeakKeyDictionary`), undeclared tool arguments are rejected, and both `list_tools` (`ListToolsRequest`) and runtime execution enforce fail-closed governance filtering.
80
+ 7. **Domain Neutrality & Free-Form Wings**: Project wings are strictly user- or agent-defined free-form strings — no hardcoded business taxonomies exist in product code, enforced by AST guard tests (`tests/test_domain_neutrality_guard.py`).
81
+ 8. **Optional Lightweight Mode & Optional LLM Summaries**: Set `GRAFO_LIGHTWEIGHT_MODE=true` to operate without heavy vector models using SQLite FTS5 BM25, and `GRAFO_LLM_MODEL=none` to run fully offline without external LLM calls.
82
+
83
+ ---
84
+
85
+ ## Architecture Overview
86
+
87
+ ```
88
+ ┌───────────────────────────┐ ┌───────────────────────────┐
89
+ │ Cursor / Windsurf │ │ Claude Desktop │
90
+ └─────────────┬─────────────┘ └─────────────┬─────────────┘
91
+ │ │
92
+ │ MCP (stdio default / SSE) │
93
+ └─────────────────┬────────────────┘
94
+ │
95
+ ▼
96
+ ┌─────────────────────────────┐ ┌─────────────────────┐
97
+ │ Concierge Graph MCP Server │ │ concierge CLI │
98
+ │ concierge-mcp (Port 8000) │ │ (10 subcommands) │
99
+ └──────────────┬──────────────┘ └──────────┬──────────┘
100
+ │ │
101
+ └───────────────┬────────────────┘
102
+ ▼
103
+ ┌──────────────────────────────┐
104
+ │ GrafoConcierge Facade │
105
+ │ + MCPToolGovernor (31) │
106
+ └──────────────┬───────────────┘
107
+ ▼
108
+ ┌──────────────────────────────┐
109
+ │ SQLite WAL/FTS5 + ChromaDB │
110
+ │ (or optional Qdrant) │
111
+ └──────────────────────────────┘
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Quick Start
117
+
118
+ ### Quick Install (`v4.1.0`)
119
+
120
+ > **Release & PyPI Status:** Version `4.1.0` supersedes the legacy `v3.8.2` release on PyPI and the pre-audit `V4.0.0` GitHub tag (kept intact in repository history).
121
+
122
+ 1. **Install via pip (or from source in editable mode):**
123
+ ```bash
124
+ # Package installation:
125
+ pip install concierge-graph
126
+
127
+ # Or editable source checkout:
128
+ git clone https://github.com/LuisinTheLegend/ConciergeGraph.git
129
+ cd ConciergeGraph
130
+ python -m venv .venv
131
+ # Linux / macOS: source .venv/bin/activate
132
+ # Windows PowerShell: .venv\Scripts\Activate.ps1
133
+ pip install --upgrade pip
134
+ pip install -e .
135
+ ```
136
+ For development and running tests (or install via `pip install -r requirements-dev.txt`; `requirements.txt` contains production runtime packages only):
137
+ ```bash
138
+ pip install -e ".[dev]"
139
+ ```
140
+
141
+ 2. **Configure environment variables (`.env`):**
142
+ ```bash
143
+ cp .env.example .env
144
+ ```
145
+ Minimal local-first configuration (LLM disabled by default if not needed):
146
+ ```env
147
+ GRAFO_LLM_MODEL=none
148
+ GRAFO_TRANSPORT=stdio
149
+ GRAFO_DB_PATH=./data/concierge.db
150
+ GRAFO_CHROMA_PATH=./data/chroma
151
+ ```
152
+ To run over HTTP/SSE instead of `stdio`:
153
+ ```env
154
+ GRAFO_TRANSPORT=sse
155
+ GRAFO_HOST=127.0.0.1
156
+ GRAFO_PORT=8000
157
+ GRAFO_API_KEY=your_optional_bearer_token
158
+ ```
159
+
160
+ 3. **Run the MCP Server or CLI:**
161
+ ```bash
162
+ # Launch MCP server (uses GRAFO_TRANSPORT: stdio default, or sse on port 8000)
163
+ concierge-mcp --help
164
+ concierge-mcp --version
165
+ concierge-mcp --transport sse
166
+
167
+ # Or start via Docker Compose (non-root UID 10001, SSE + /health check)
168
+ docker compose up -d --build
169
+
170
+ # Use the terminal CLI (10 subcommands)
171
+ concierge --help
172
+ concierge register --name my-project --wing backend/core
173
+ concierge mine --path /path/to/my-project --name my-project
174
+ concierge search --query "authentication flow" --project <project-uuid>
175
+ ```
176
+ When running over HTTP/SSE, `GET /health` and `HEAD /health` return `200 {"status": "ok"}` without requiring `GRAFO_API_KEY`, while `/sse`, `/messages/`, and all other paths remain protected by pure ASGI `Authorization: Bearer` validation.
177
+
178
+ ---
179
+
180
+ ## MCP Tools (31 Live Tools)
181
+
182
+ | Category | Count | Tools |
183
+ | :--- | :---: | :--- |
184
+ | **`READ_ONLY`** | 17 | `concierge_search`, `concierge_resume`, `concierge_load`, `concierge_status`, `concierge_list_projects`, `concierge_list_facts`, `concierge_get_memory`, `get_full_topology`, `get_trajectories`, `find_similar`, `search_symbols`, `get_implementations`, `get_callers`, `concierge_get_call_chain`, `count_embeddings`, `agent_get_checkpoint`, `agent_list_checkpoints` |
185
+ | **`LOCAL_MUTATION`** | 12 | `concierge_register`, `concierge_mine`, `concierge_commit`, `concierge_set_state`, `concierge_wakeup`, `concierge_store_fact`, `concierge_set_memory`, `concierge_feedback`, `update_project`, `add_reference_wing`, `remove_reference_wing`, `agent_save_checkpoint` |
186
+ | **`DANGEROUS`** | 2 | `delete_project`, `reset_collection` |
187
+
188
+ See [`docs-grafo-concierge/README.md`](docs-grafo-concierge/README.md) for architecture details and the full list of CLI subcommands.
189
+
190
+ ---
191
+
192
+ ## Testing & Verification
193
+
194
+ The active V4 core is covered by **369 passing automated tests** (verified in normal and `--reverse` order, plus CI across Linux, Windows, and real container `docker-smoke`):
195
+
196
+ ```bash
197
+ python -m pytest tests/ -q
198
+ ```
199
+
200
+ ---
201
+
202
+ ## Contributing & Lineage
203
+
204
+ - Read [`CONTRIBUTING.md`](CONTRIBUTING.md) for architectural pillars, testing rules, and MCP governance contracts.
205
+ - Read [`ATTRIBUTION_AND_LINEAGE.md`](ATTRIBUTION_AND_LINEAGE.md) for technical credits and the active vs. quarantined status matrix.
206
+ - Read [`CHANGELOG.md`](CHANGELOG.md) for recent changes and breaking-change migration notes.
207
+
208
+ ## License
209
+
210
+ Distributed under the MIT License. See [`LICENSE`](LICENSE) for details.