concierge-graph 3.8.2__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.
- concierge_graph-3.8.2/LICENSE +21 -0
- concierge_graph-3.8.2/PKG-INFO +327 -0
- concierge_graph-3.8.2/README.md +261 -0
- concierge_graph-3.8.2/agents/__init__.py +14 -0
- concierge_graph-3.8.2/agents/revisor_critico.py +610 -0
- concierge_graph-3.8.2/concierge_graph.egg-info/PKG-INFO +327 -0
- concierge_graph-3.8.2/concierge_graph.egg-info/SOURCES.txt +47 -0
- concierge_graph-3.8.2/concierge_graph.egg-info/dependency_links.txt +1 -0
- concierge_graph-3.8.2/concierge_graph.egg-info/entry_points.txt +3 -0
- concierge_graph-3.8.2/concierge_graph.egg-info/requires.txt +20 -0
- concierge_graph-3.8.2/concierge_graph.egg-info/top_level.txt +8 -0
- concierge_graph-3.8.2/core/__init__.py +23 -0
- concierge_graph-3.8.2/core/config.py +192 -0
- concierge_graph-3.8.2/core/hybrid_search.py +288 -0
- concierge_graph-3.8.2/core/memory_extractor.py +245 -0
- concierge_graph-3.8.2/core/middleware.py +723 -0
- concierge_graph-3.8.2/core/probabilistic_retriever.py +99 -0
- concierge_graph-3.8.2/core/project_index.py +316 -0
- concierge_graph-3.8.2/core/vector_backend.py +471 -0
- concierge_graph-3.8.2/ingestion/__init__.py +25 -0
- concierge_graph-3.8.2/ingestion/crawler.py +722 -0
- concierge_graph-3.8.2/ingestion/orchestrator.py +920 -0
- concierge_graph-3.8.2/ingestion/parser.py +984 -0
- concierge_graph-3.8.2/ingestion/summarizer.py +948 -0
- concierge_graph-3.8.2/interface/__init__.py +16 -0
- concierge_graph-3.8.2/interface/action_hooks.py +261 -0
- concierge_graph-3.8.2/interface/cli.py +391 -0
- concierge_graph-3.8.2/interface/mcp_server.py +1737 -0
- concierge_graph-3.8.2/main.py +281 -0
- concierge_graph-3.8.2/pyproject.toml +105 -0
- concierge_graph-3.8.2/scripts/bootstrap_core_memory.py +93 -0
- concierge_graph-3.8.2/services/__init__.py +13 -0
- concierge_graph-3.8.2/services/janitor.py +762 -0
- concierge_graph-3.8.2/setup.cfg +4 -0
- concierge_graph-3.8.2/storage/__init__.py +31 -0
- concierge_graph-3.8.2/storage/base_backend.py +241 -0
- concierge_graph-3.8.2/storage/connection.py +310 -0
- concierge_graph-3.8.2/storage/logic.py +703 -0
- concierge_graph-3.8.2/storage/schema.py +390 -0
- concierge_graph-3.8.2/storage/semantic_logic.py +125 -0
- concierge_graph-3.8.2/storage/store.py +802 -0
- concierge_graph-3.8.2/storage/vector_store.py +759 -0
- concierge_graph-3.8.2/tests/test_chunk_cache.py +67 -0
- concierge_graph-3.8.2/tests/test_conversational_db.py +138 -0
- concierge_graph-3.8.2/tests/test_extraction_noop.py +178 -0
- concierge_graph-3.8.2/tests/test_ignore.py +91 -0
- concierge_graph-3.8.2/tests/test_lightweight.py +71 -0
- concierge_graph-3.8.2/tests/test_probabilistic_retriever.py +149 -0
- concierge_graph-3.8.2/tests/test_topology.py +141 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 LuisinTheLegend / Grafo Concierge Team
|
|
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,327 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: concierge-graph
|
|
3
|
+
Version: 3.8.2
|
|
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: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 LuisinTheLegend / Grafo Concierge Team
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/LuisinTheLegend/GrafoConcierge
|
|
29
|
+
Project-URL: Repository, https://github.com/LuisinTheLegend/GrafoConcierge
|
|
30
|
+
Project-URL: Issues, https://github.com/LuisinTheLegend/GrafoConcierge/issues
|
|
31
|
+
Keywords: mcp,memory,graph,ai-agents,rag,semantic-search,vector-database,llm,cursor,claude-desktop,embeddings
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Intended Audience :: Developers
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Operating System :: OS Independent
|
|
36
|
+
Classifier: Programming Language :: Python :: 3
|
|
37
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
42
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
43
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
44
|
+
Requires-Python: >=3.10
|
|
45
|
+
Description-Content-Type: text/markdown
|
|
46
|
+
License-File: LICENSE
|
|
47
|
+
Requires-Dist: chromadb>=1.0
|
|
48
|
+
Requires-Dist: mcp>=1.0
|
|
49
|
+
Requires-Dist: sentence-transformers>=3.0
|
|
50
|
+
Requires-Dist: python-dotenv>=1.0
|
|
51
|
+
Requires-Dist: starlette>=0.36
|
|
52
|
+
Requires-Dist: sse-starlette>=2.0
|
|
53
|
+
Requires-Dist: uvicorn>=0.25
|
|
54
|
+
Requires-Dist: httpx>=0.25
|
|
55
|
+
Requires-Dist: pydantic>=2.0
|
|
56
|
+
Requires-Dist: rich>=13.0
|
|
57
|
+
Requires-Dist: tenacity>=8.0
|
|
58
|
+
Requires-Dist: pathspec>=0.11
|
|
59
|
+
Provides-Extra: qdrant
|
|
60
|
+
Requires-Dist: qdrant-client>=1.7; extra == "qdrant"
|
|
61
|
+
Provides-Extra: dev
|
|
62
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
63
|
+
Requires-Dist: flake8>=6.0; extra == "dev"
|
|
64
|
+
Requires-Dist: mypy>=1.0; extra == "dev"
|
|
65
|
+
Dynamic: license-file
|
|
66
|
+
|
|
67
|
+
English ยท [Portuguรชs (Brasil)](README.pt-BR.md)
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
# ๐ง Concierge Graph v3.8.2
|
|
71
|
+
|
|
72
|
+
**The Open-Source Long-Term Memory (LTM) & Cognitive Palace for AI Agents, IDEs & Developer Environments**
|
|
73
|
+
|
|
74
|
+
[](LICENSE)
|
|
75
|
+
[](pyproject.toml)
|
|
76
|
+
[](https://modelcontextprotocol.io/)
|
|
77
|
+
[](docker-compose.yml)
|
|
78
|
+
|
|
79
|
+
Concierge Graph is a high-performance, local cognitive memory server designed to solve LLM "amnesia" and context window pollution. Unlike simple RAG (Retrieval-Augmented Generation) scripts, Concierge Graph acts as a bi-temporal, self-healing memory engine combining relational SQL persistence, vector search, hierarchical context synthesis (Zoom Gear), and autonomous background maintenance (Janitor Loop).
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## ๐ก What is Concierge Graph? (For Beginners & Senior Devs)
|
|
84
|
+
|
|
85
|
+
### ๐ถ Simple Explanation (The Analogy)
|
|
86
|
+
> Imagine hiring a brilliant senior software engineer who suffers from short-term memory loss. Every time you open a new chat window in Cursor or Claude Desktop, they forget your project structure, coding standards, and past architectural decisions.
|
|
87
|
+
>
|
|
88
|
+
> **Concierge Graph is that engineer's permanent external brain.** Connected seamlessly via the Model Context Protocol (MCP), your AI assistant automatically consults, learns from, and updates this brain in millisecondsโwithout you ever copying and pasting context again!
|
|
89
|
+
|
|
90
|
+
### ๐งโโ๏ธ Technical Deep-Dive (For Engineers)
|
|
91
|
+
Concierge Graph is a local/VPS daemon that provides:
|
|
92
|
+
1. **Bi-Temporal Fact Persistence**: Stores semantic facts and code entities with explicit valid time and transaction time tracking.
|
|
93
|
+
2. **Hybrid Search v4 Engine**: Balances dense vector embeddings (50%), precise keyword signatures via SQLite FTS5 BM25 (25%), and graph signals (25% combining centrality and exponential recency decay $W = W_0 \cdot e^{-\lambda t}$).
|
|
94
|
+
3. **AST-Aware Apex Ingestion**: Parses Python, TypeScript, JS, Go, Rust, Java, C/C++ files into structural AST nodes with delta-hashing (SHA-256) to skip unmodified code.
|
|
95
|
+
4. **Autonomous Self-Healing (Janitor Loop)**: Operates in a background thread to reconcile relational SQLite tables with vector collections, prune orphan embeddings, and decay inactive context.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## ๐ Simultaneous Multi-Client Integration via MCP
|
|
100
|
+
|
|
101
|
+
Powered by Anthropic's **Model Context Protocol (MCP)**, a single Concierge Graph server instance communicates **simultaneously** with all your favorite tools:
|
|
102
|
+
|
|
103
|
+
```
|
|
104
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
105
|
+
โ Cursor / Windsurf โ โ Claude Desktop โ
|
|
106
|
+
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
|
|
107
|
+
โ โ
|
|
108
|
+
โ JSON-RPC / SSE (MCP) โ
|
|
109
|
+
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
|
|
110
|
+
โ
|
|
111
|
+
โผ
|
|
112
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
113
|
+
โ ๐ง Concierge Graph Server โ
|
|
114
|
+
โ (Local / VPS - Port 8000) โ
|
|
115
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
* ๐ป **Cursor & Windsurf**: Your IDE agent dynamically searches, recalls, and commits project memory as you write code.
|
|
119
|
+
* ๐ฌ **Claude Desktop**: Grants your desktop AI assistant instant macro awareness of your repos.
|
|
120
|
+
* ๐ค **Autonomous Agents & Workflows**: Connect n8n, LangChain, AutoGen, or custom python scripts via SSE endpoints.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## โก Quick Start Guide (3 Minutes)
|
|
125
|
+
|
|
126
|
+
### Option 1: Install via PyPI (Recommended for Most Users)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Install Grafo Concierge package & CLI
|
|
130
|
+
pip install concierge-graph
|
|
131
|
+
|
|
132
|
+
# Uninstall anytime
|
|
133
|
+
pip install concierge-graph --upgrade # to update
|
|
134
|
+
pip uninstall concierge-graph # to uninstall
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Option 2: Local Setup from Source (For Developers & Contributors)
|
|
138
|
+
|
|
139
|
+
1. **Clone & Install in Editable Mode**:
|
|
140
|
+
```bash
|
|
141
|
+
git clone https://github.com/LuisinTheLegend/GrafoConcierge.git
|
|
142
|
+
cd GrafoConcierge
|
|
143
|
+
pip install -e .[dev]
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
2. **Configure Environment (`.env`)**:
|
|
147
|
+
```bash
|
|
148
|
+
cp .env.example .env
|
|
149
|
+
```
|
|
150
|
+
Add your Gemini or OpenAI key:
|
|
151
|
+
```env
|
|
152
|
+
GRAFO_LLM_API_KEY=your_gemini_api_key_here
|
|
153
|
+
GRAFO_LLM_MODEL=gemini-2.0-flash
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
3. **Start the MCP Server**:
|
|
157
|
+
```bash
|
|
158
|
+
concierge-mcp
|
|
159
|
+
# or: python main.py
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
### Option 2: VPS Deployment (Direct `pip` or `Docker`) ๐
|
|
165
|
+
|
|
166
|
+
You can host Concierge Graph on any Linux VPS (Ubuntu/Debian) in two ways:
|
|
167
|
+
|
|
168
|
+
#### A) Direct Installation (Native `pip`)
|
|
169
|
+
```bash
|
|
170
|
+
# 1. Install directly on your VPS
|
|
171
|
+
pip install concierge-graph
|
|
172
|
+
|
|
173
|
+
# 2. Set your environment variables (or create a .env file)
|
|
174
|
+
export GRAFO_LLM_API_KEY="your_gemini_key"
|
|
175
|
+
export GRAFO_HOST="0.0.0.0"
|
|
176
|
+
export GRAFO_API_KEY="your_secure_vps_token"
|
|
177
|
+
|
|
178
|
+
# 3. Launch the server
|
|
179
|
+
concierge-mcp
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### B) Containerized Installation (Docker ๐ณ)
|
|
183
|
+
```bash
|
|
184
|
+
# Set your API Key for remote security in .env
|
|
185
|
+
echo "GRAFO_API_KEY=your_secure_vps_token" >> .env
|
|
186
|
+
|
|
187
|
+
# Boot the containerized server
|
|
188
|
+
docker compose up -d
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## ๐ป 1-Click Configuration for IDEs & Claude Desktop
|
|
194
|
+
|
|
195
|
+
### For Claude Desktop (`claude_desktop_config.json`)
|
|
196
|
+
Add Concierge Graph to your configuration file:
|
|
197
|
+
|
|
198
|
+
```json
|
|
199
|
+
{
|
|
200
|
+
"mcpServers": {
|
|
201
|
+
"concierge-graph": {
|
|
202
|
+
"command": "python",
|
|
203
|
+
"args": ["-m", "interface.mcp_server"],
|
|
204
|
+
"cwd": "/path/to/GrafoConcierge",
|
|
205
|
+
"env": {
|
|
206
|
+
"GRAFO_LLM_API_KEY": "your_api_key_here"
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### For Remote VPS / SSE Connections (Cursor / Custom Scripts)
|
|
214
|
+
When running on a server:
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"mcpServers": {
|
|
218
|
+
"concierge-graph": {
|
|
219
|
+
"url": "http://your-vps-ip:8000/sse",
|
|
220
|
+
"headers": {
|
|
221
|
+
"Authorization": "Bearer your_secure_remote_token"
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## ๐ Performance Benchmarks (Colossus Protocol)
|
|
231
|
+
|
|
232
|
+
Tested against 20,000 code nodes under the **Colossus Protocol**:
|
|
233
|
+
|
|
234
|
+
| Metric | Result (20,000 nodes) |
|
|
235
|
+
| --- | --- |
|
|
236
|
+
| **Search Latency (P50)** | 41.69 ms |
|
|
237
|
+
| **Search Latency (P99)** | 112.75 ms |
|
|
238
|
+
| **Scalability Factor** | 0.93x (Linear performance preserved) |
|
|
239
|
+
| **Ingestion Throughput (SQLite)** | ~536 nodes/second |
|
|
240
|
+
| **Ingestion Throughput (ChromaDB)** | ~914 vectors/second |
|
|
241
|
+
| **Background Maintenance (Janitor)** | 20,000 orphan vectors reconciled in ~11s |
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## ๐ ๏ธ Hybrid Search v4 Formula
|
|
246
|
+
|
|
247
|
+
Relevance scores are calculated by composing three distinct signals:
|
|
248
|
+
|
|
249
|
+
$$\text{Score} = (0.50 \times \text{Vector Similarity}) + (0.25 \times \text{Normalized FTS5 BM25}) + (0.25 \times \max(\text{Recency}, \text{Centrality}))$$
|
|
250
|
+
|
|
251
|
+
1. **Vector Similarity (50%)**: Captures deep conceptual meaning using dense embeddings.
|
|
252
|
+
2. **FTS5 BM25 (25%)**: Exact token signatures for function names, classes, and symbols.
|
|
253
|
+
3. **Graph Signals (25%)**:
|
|
254
|
+
- **Centrality**: Relative connectivity of a node (in-degree normalized).
|
|
255
|
+
- **Recency**: Time-based exponential decay ensuring historical context ages gracefully:
|
|
256
|
+
$$W = W_0 \cdot e^{-\lambda t}$$
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## ๐ Core MCP Tools Reference
|
|
261
|
+
|
|
262
|
+
* **`concierge_mine`**: Ingests a directory, chunks code (AST), extracts tags, and generates L0/L1/L2 summaries.
|
|
263
|
+
* **`concierge_search`**: Runs the complete Hybrid Search v4 pipeline across indexed projects.
|
|
264
|
+
* **`concierge_wakeup`**: Reactivates agent consciousness on session start by returning the Context Compass, reference wings, and recent commits.
|
|
265
|
+
* **`concierge_resume`**: Retrieves macro summary of project context (ideal for system prompt injection).
|
|
266
|
+
* **`concierge_load`**: On-demand lazy loader for full node contents, edges, and dependencies.
|
|
267
|
+
* **`concierge_commit`**: Registers audited architectural changes to the cognitive ledger.
|
|
268
|
+
* **`concierge_store_fact`**: Records user preferences and architectural rules with bi-temporal invalidation.
|
|
269
|
+
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
## ๐ ๏ธ Global CLI Subcommands Reference (`concierge`)
|
|
273
|
+
|
|
274
|
+
After running `pip install concierge-graph`, two global terminal commands are installed via `pyproject.toml`:
|
|
275
|
+
1. **`concierge-mcp`**: Boots the FastMCP Server daemon.
|
|
276
|
+
2. **`concierge`**: Multifunctional CLI utility supporting the following subcommands:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
# 1. Register a new workspace/project
|
|
280
|
+
concierge register --name my-project --wing backend --privacy PUBLIC
|
|
281
|
+
|
|
282
|
+
# 2. Mine / Ingest a codebase directory into the memory graph
|
|
283
|
+
concierge mine --path /path/to/codebase --name my-project
|
|
284
|
+
|
|
285
|
+
# 3. Perform Hybrid Search v4 across indexed memory
|
|
286
|
+
concierge search --query "authentication middleware" --project my-project
|
|
287
|
+
|
|
288
|
+
# 4. Reactivate agent consciousness (Compass + Wings + Commits)
|
|
289
|
+
concierge wakeup --project my-project
|
|
290
|
+
|
|
291
|
+
# 5. Retrieve Context Compass macro summary
|
|
292
|
+
concierge resume --project my-project
|
|
293
|
+
|
|
294
|
+
# 6. Register audited architectural commit to ledger
|
|
295
|
+
concierge commit --project <uuid> --phase build --technical_changes "Added Auth JWT"
|
|
296
|
+
|
|
297
|
+
# 7. Lazy load a single node on demand
|
|
298
|
+
concierge load --node_id 42
|
|
299
|
+
|
|
300
|
+
# 8. Display system health, counts, and database status
|
|
301
|
+
concierge status
|
|
302
|
+
|
|
303
|
+
# 9. List all registered projects inside the local database
|
|
304
|
+
concierge projects
|
|
305
|
+
|
|
306
|
+
# 10. Purge a project and all associated relational & vector records
|
|
307
|
+
concierge delete --project my-project
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## ๐งช Test Suite & Health Diagnostics
|
|
313
|
+
|
|
314
|
+
Run all unit and stress tests:
|
|
315
|
+
```bash
|
|
316
|
+
python -m pytest
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
Run full memory diagnostics:
|
|
320
|
+
```bash
|
|
321
|
+
python -m tests.check_brain
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
---
|
|
325
|
+
|
|
326
|
+
## ๐ License
|
|
327
|
+
Distributed under the MIT License. See `LICENSE` for details.
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
English ยท [Portuguรชs (Brasil)](README.pt-BR.md)
|
|
2
|
+
---
|
|
3
|
+
|
|
4
|
+
# ๐ง Concierge Graph v3.8.2
|
|
5
|
+
|
|
6
|
+
**The Open-Source Long-Term Memory (LTM) & Cognitive Palace for AI Agents, IDEs & Developer Environments**
|
|
7
|
+
|
|
8
|
+
[](LICENSE)
|
|
9
|
+
[](pyproject.toml)
|
|
10
|
+
[](https://modelcontextprotocol.io/)
|
|
11
|
+
[](docker-compose.yml)
|
|
12
|
+
|
|
13
|
+
Concierge Graph is a high-performance, local cognitive memory server designed to solve LLM "amnesia" and context window pollution. Unlike simple RAG (Retrieval-Augmented Generation) scripts, Concierge Graph acts as a bi-temporal, self-healing memory engine combining relational SQL persistence, vector search, hierarchical context synthesis (Zoom Gear), and autonomous background maintenance (Janitor Loop).
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## ๐ก What is Concierge Graph? (For Beginners & Senior Devs)
|
|
18
|
+
|
|
19
|
+
### ๐ถ Simple Explanation (The Analogy)
|
|
20
|
+
> Imagine hiring a brilliant senior software engineer who suffers from short-term memory loss. Every time you open a new chat window in Cursor or Claude Desktop, they forget your project structure, coding standards, and past architectural decisions.
|
|
21
|
+
>
|
|
22
|
+
> **Concierge Graph is that engineer's permanent external brain.** Connected seamlessly via the Model Context Protocol (MCP), your AI assistant automatically consults, learns from, and updates this brain in millisecondsโwithout you ever copying and pasting context again!
|
|
23
|
+
|
|
24
|
+
### ๐งโโ๏ธ Technical Deep-Dive (For Engineers)
|
|
25
|
+
Concierge Graph is a local/VPS daemon that provides:
|
|
26
|
+
1. **Bi-Temporal Fact Persistence**: Stores semantic facts and code entities with explicit valid time and transaction time tracking.
|
|
27
|
+
2. **Hybrid Search v4 Engine**: Balances dense vector embeddings (50%), precise keyword signatures via SQLite FTS5 BM25 (25%), and graph signals (25% combining centrality and exponential recency decay $W = W_0 \cdot e^{-\lambda t}$).
|
|
28
|
+
3. **AST-Aware Apex Ingestion**: Parses Python, TypeScript, JS, Go, Rust, Java, C/C++ files into structural AST nodes with delta-hashing (SHA-256) to skip unmodified code.
|
|
29
|
+
4. **Autonomous Self-Healing (Janitor Loop)**: Operates in a background thread to reconcile relational SQLite tables with vector collections, prune orphan embeddings, and decay inactive context.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## ๐ Simultaneous Multi-Client Integration via MCP
|
|
34
|
+
|
|
35
|
+
Powered by Anthropic's **Model Context Protocol (MCP)**, a single Concierge Graph server instance communicates **simultaneously** with all your favorite tools:
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
39
|
+
โ Cursor / Windsurf โ โ Claude Desktop โ
|
|
40
|
+
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโ
|
|
41
|
+
โ โ
|
|
42
|
+
โ JSON-RPC / SSE (MCP) โ
|
|
43
|
+
โโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโ
|
|
44
|
+
โ
|
|
45
|
+
โผ
|
|
46
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
47
|
+
โ ๐ง Concierge Graph Server โ
|
|
48
|
+
โ (Local / VPS - Port 8000) โ
|
|
49
|
+
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
* ๐ป **Cursor & Windsurf**: Your IDE agent dynamically searches, recalls, and commits project memory as you write code.
|
|
53
|
+
* ๐ฌ **Claude Desktop**: Grants your desktop AI assistant instant macro awareness of your repos.
|
|
54
|
+
* ๐ค **Autonomous Agents & Workflows**: Connect n8n, LangChain, AutoGen, or custom python scripts via SSE endpoints.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## โก Quick Start Guide (3 Minutes)
|
|
59
|
+
|
|
60
|
+
### Option 1: Install via PyPI (Recommended for Most Users)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Install Grafo Concierge package & CLI
|
|
64
|
+
pip install concierge-graph
|
|
65
|
+
|
|
66
|
+
# Uninstall anytime
|
|
67
|
+
pip install concierge-graph --upgrade # to update
|
|
68
|
+
pip uninstall concierge-graph # to uninstall
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Option 2: Local Setup from Source (For Developers & Contributors)
|
|
72
|
+
|
|
73
|
+
1. **Clone & Install in Editable Mode**:
|
|
74
|
+
```bash
|
|
75
|
+
git clone https://github.com/LuisinTheLegend/GrafoConcierge.git
|
|
76
|
+
cd GrafoConcierge
|
|
77
|
+
pip install -e .[dev]
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
2. **Configure Environment (`.env`)**:
|
|
81
|
+
```bash
|
|
82
|
+
cp .env.example .env
|
|
83
|
+
```
|
|
84
|
+
Add your Gemini or OpenAI key:
|
|
85
|
+
```env
|
|
86
|
+
GRAFO_LLM_API_KEY=your_gemini_api_key_here
|
|
87
|
+
GRAFO_LLM_MODEL=gemini-2.0-flash
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
3. **Start the MCP Server**:
|
|
91
|
+
```bash
|
|
92
|
+
concierge-mcp
|
|
93
|
+
# or: python main.py
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
---
|
|
97
|
+
|
|
98
|
+
### Option 2: VPS Deployment (Direct `pip` or `Docker`) ๐
|
|
99
|
+
|
|
100
|
+
You can host Concierge Graph on any Linux VPS (Ubuntu/Debian) in two ways:
|
|
101
|
+
|
|
102
|
+
#### A) Direct Installation (Native `pip`)
|
|
103
|
+
```bash
|
|
104
|
+
# 1. Install directly on your VPS
|
|
105
|
+
pip install concierge-graph
|
|
106
|
+
|
|
107
|
+
# 2. Set your environment variables (or create a .env file)
|
|
108
|
+
export GRAFO_LLM_API_KEY="your_gemini_key"
|
|
109
|
+
export GRAFO_HOST="0.0.0.0"
|
|
110
|
+
export GRAFO_API_KEY="your_secure_vps_token"
|
|
111
|
+
|
|
112
|
+
# 3. Launch the server
|
|
113
|
+
concierge-mcp
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
#### B) Containerized Installation (Docker ๐ณ)
|
|
117
|
+
```bash
|
|
118
|
+
# Set your API Key for remote security in .env
|
|
119
|
+
echo "GRAFO_API_KEY=your_secure_vps_token" >> .env
|
|
120
|
+
|
|
121
|
+
# Boot the containerized server
|
|
122
|
+
docker compose up -d
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## ๐ป 1-Click Configuration for IDEs & Claude Desktop
|
|
128
|
+
|
|
129
|
+
### For Claude Desktop (`claude_desktop_config.json`)
|
|
130
|
+
Add Concierge Graph to your configuration file:
|
|
131
|
+
|
|
132
|
+
```json
|
|
133
|
+
{
|
|
134
|
+
"mcpServers": {
|
|
135
|
+
"concierge-graph": {
|
|
136
|
+
"command": "python",
|
|
137
|
+
"args": ["-m", "interface.mcp_server"],
|
|
138
|
+
"cwd": "/path/to/GrafoConcierge",
|
|
139
|
+
"env": {
|
|
140
|
+
"GRAFO_LLM_API_KEY": "your_api_key_here"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### For Remote VPS / SSE Connections (Cursor / Custom Scripts)
|
|
148
|
+
When running on a server:
|
|
149
|
+
```json
|
|
150
|
+
{
|
|
151
|
+
"mcpServers": {
|
|
152
|
+
"concierge-graph": {
|
|
153
|
+
"url": "http://your-vps-ip:8000/sse",
|
|
154
|
+
"headers": {
|
|
155
|
+
"Authorization": "Bearer your_secure_remote_token"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## ๐ Performance Benchmarks (Colossus Protocol)
|
|
165
|
+
|
|
166
|
+
Tested against 20,000 code nodes under the **Colossus Protocol**:
|
|
167
|
+
|
|
168
|
+
| Metric | Result (20,000 nodes) |
|
|
169
|
+
| --- | --- |
|
|
170
|
+
| **Search Latency (P50)** | 41.69 ms |
|
|
171
|
+
| **Search Latency (P99)** | 112.75 ms |
|
|
172
|
+
| **Scalability Factor** | 0.93x (Linear performance preserved) |
|
|
173
|
+
| **Ingestion Throughput (SQLite)** | ~536 nodes/second |
|
|
174
|
+
| **Ingestion Throughput (ChromaDB)** | ~914 vectors/second |
|
|
175
|
+
| **Background Maintenance (Janitor)** | 20,000 orphan vectors reconciled in ~11s |
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## ๐ ๏ธ Hybrid Search v4 Formula
|
|
180
|
+
|
|
181
|
+
Relevance scores are calculated by composing three distinct signals:
|
|
182
|
+
|
|
183
|
+
$$\text{Score} = (0.50 \times \text{Vector Similarity}) + (0.25 \times \text{Normalized FTS5 BM25}) + (0.25 \times \max(\text{Recency}, \text{Centrality}))$$
|
|
184
|
+
|
|
185
|
+
1. **Vector Similarity (50%)**: Captures deep conceptual meaning using dense embeddings.
|
|
186
|
+
2. **FTS5 BM25 (25%)**: Exact token signatures for function names, classes, and symbols.
|
|
187
|
+
3. **Graph Signals (25%)**:
|
|
188
|
+
- **Centrality**: Relative connectivity of a node (in-degree normalized).
|
|
189
|
+
- **Recency**: Time-based exponential decay ensuring historical context ages gracefully:
|
|
190
|
+
$$W = W_0 \cdot e^{-\lambda t}$$
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## ๐ Core MCP Tools Reference
|
|
195
|
+
|
|
196
|
+
* **`concierge_mine`**: Ingests a directory, chunks code (AST), extracts tags, and generates L0/L1/L2 summaries.
|
|
197
|
+
* **`concierge_search`**: Runs the complete Hybrid Search v4 pipeline across indexed projects.
|
|
198
|
+
* **`concierge_wakeup`**: Reactivates agent consciousness on session start by returning the Context Compass, reference wings, and recent commits.
|
|
199
|
+
* **`concierge_resume`**: Retrieves macro summary of project context (ideal for system prompt injection).
|
|
200
|
+
* **`concierge_load`**: On-demand lazy loader for full node contents, edges, and dependencies.
|
|
201
|
+
* **`concierge_commit`**: Registers audited architectural changes to the cognitive ledger.
|
|
202
|
+
* **`concierge_store_fact`**: Records user preferences and architectural rules with bi-temporal invalidation.
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## ๐ ๏ธ Global CLI Subcommands Reference (`concierge`)
|
|
207
|
+
|
|
208
|
+
After running `pip install concierge-graph`, two global terminal commands are installed via `pyproject.toml`:
|
|
209
|
+
1. **`concierge-mcp`**: Boots the FastMCP Server daemon.
|
|
210
|
+
2. **`concierge`**: Multifunctional CLI utility supporting the following subcommands:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
# 1. Register a new workspace/project
|
|
214
|
+
concierge register --name my-project --wing backend --privacy PUBLIC
|
|
215
|
+
|
|
216
|
+
# 2. Mine / Ingest a codebase directory into the memory graph
|
|
217
|
+
concierge mine --path /path/to/codebase --name my-project
|
|
218
|
+
|
|
219
|
+
# 3. Perform Hybrid Search v4 across indexed memory
|
|
220
|
+
concierge search --query "authentication middleware" --project my-project
|
|
221
|
+
|
|
222
|
+
# 4. Reactivate agent consciousness (Compass + Wings + Commits)
|
|
223
|
+
concierge wakeup --project my-project
|
|
224
|
+
|
|
225
|
+
# 5. Retrieve Context Compass macro summary
|
|
226
|
+
concierge resume --project my-project
|
|
227
|
+
|
|
228
|
+
# 6. Register audited architectural commit to ledger
|
|
229
|
+
concierge commit --project <uuid> --phase build --technical_changes "Added Auth JWT"
|
|
230
|
+
|
|
231
|
+
# 7. Lazy load a single node on demand
|
|
232
|
+
concierge load --node_id 42
|
|
233
|
+
|
|
234
|
+
# 8. Display system health, counts, and database status
|
|
235
|
+
concierge status
|
|
236
|
+
|
|
237
|
+
# 9. List all registered projects inside the local database
|
|
238
|
+
concierge projects
|
|
239
|
+
|
|
240
|
+
# 10. Purge a project and all associated relational & vector records
|
|
241
|
+
concierge delete --project my-project
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## ๐งช Test Suite & Health Diagnostics
|
|
247
|
+
|
|
248
|
+
Run all unit and stress tests:
|
|
249
|
+
```bash
|
|
250
|
+
python -m pytest
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
Run full memory diagnostics:
|
|
254
|
+
```bash
|
|
255
|
+
python -m tests.check_brain
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
---
|
|
259
|
+
|
|
260
|
+
## ๐ License
|
|
261
|
+
Distributed under the MIT License. See `LICENSE` for details.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""
|
|
2
|
+
agents/__init__.py โ Grafo Concierge v3.8.0 (Absolute Solidity)
|
|
3
|
+
|
|
4
|
+
agents/ package โ Guardians of Evolution.
|
|
5
|
+
|
|
6
|
+
Exports the critical AI agents:
|
|
7
|
+
- RevisorCritico โ Evolution Auditor + Drawer Reranking
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from agents.revisor_critico import RevisorCritico
|
|
11
|
+
|
|
12
|
+
__all__ = [
|
|
13
|
+
"RevisorCritico",
|
|
14
|
+
]
|