intentmind 0.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.
- intentmind-0.1.0/LICENSE +21 -0
- intentmind-0.1.0/PKG-INFO +232 -0
- intentmind-0.1.0/README.md +176 -0
- intentmind-0.1.0/pyproject.toml +63 -0
- intentmind-0.1.0/setup.cfg +4 -0
- intentmind-0.1.0/src/intentmind/__init__.py +3 -0
- intentmind-0.1.0/src/intentmind/benchmark/__init__.py +3 -0
- intentmind-0.1.0/src/intentmind/benchmark/runner.py +345 -0
- intentmind-0.1.0/src/intentmind/benchmark/utils.py +55 -0
- intentmind-0.1.0/src/intentmind/builders/__init__.py +2 -0
- intentmind-0.1.0/src/intentmind/builders/prompt_builder.py +122 -0
- intentmind-0.1.0/src/intentmind/embeddings/__init__.py +8 -0
- intentmind-0.1.0/src/intentmind/embeddings/base.py +12 -0
- intentmind-0.1.0/src/intentmind/embeddings/fake.py +79 -0
- intentmind-0.1.0/src/intentmind/embeddings/sentence_transformer.py +20 -0
- intentmind-0.1.0/src/intentmind/engines/__init__.py +5 -0
- intentmind-0.1.0/src/intentmind/engines/emotion_engine.py +36 -0
- intentmind-0.1.0/src/intentmind/engines/energy_engine.py +239 -0
- intentmind-0.1.0/src/intentmind/engines/intent_engine.py +750 -0
- intentmind-0.1.0/src/intentmind/engines/recall_engine.py +562 -0
- intentmind-0.1.0/src/intentmind/indices/__init__.py +5 -0
- intentmind-0.1.0/src/intentmind/indices/base.py +21 -0
- intentmind-0.1.0/src/intentmind/indices/exact.py +31 -0
- intentmind-0.1.0/src/intentmind/indices/faiss.py +75 -0
- intentmind-0.1.0/src/intentmind/integrations/__init__.py +5 -0
- intentmind-0.1.0/src/intentmind/integrations/langchain.py +56 -0
- intentmind-0.1.0/src/intentmind/models.py +118 -0
- intentmind-0.1.0/src/intentmind/persistence/__init__.py +2 -0
- intentmind-0.1.0/src/intentmind/persistence/json_persistence.py +41 -0
- intentmind-0.1.0/src/intentmind/runtime.py +272 -0
- intentmind-0.1.0/src/intentmind/store.py +167 -0
- intentmind-0.1.0/src/intentmind/vis.py +72 -0
- intentmind-0.1.0/src/intentmind.egg-info/PKG-INFO +232 -0
- intentmind-0.1.0/src/intentmind.egg-info/SOURCES.txt +47 -0
- intentmind-0.1.0/src/intentmind.egg-info/dependency_links.txt +1 -0
- intentmind-0.1.0/src/intentmind.egg-info/requires.txt +46 -0
- intentmind-0.1.0/src/intentmind.egg-info/top_level.txt +1 -0
- intentmind-0.1.0/tests/test_associative_recall_line.py +48 -0
- intentmind-0.1.0/tests/test_benchmark_cost.py +93 -0
- intentmind-0.1.0/tests/test_benchmark_multihop.py +103 -0
- intentmind-0.1.0/tests/test_detailed_system.py +275 -0
- intentmind-0.1.0/tests/test_graph_pollution_control.py +58 -0
- intentmind-0.1.0/tests/test_integrations.py +33 -0
- intentmind-0.1.0/tests/test_persistence.py +46 -0
- intentmind-0.1.0/tests/test_quality_gate.py +69 -0
- intentmind-0.1.0/tests/test_query_field_state_safety.py +31 -0
- intentmind-0.1.0/tests/test_real_world_benchmark_runner.py +36 -0
- intentmind-0.1.0/tests/test_real_world_memory_scenario.py +85 -0
- intentmind-0.1.0/tests/test_structured_extractor.py +46 -0
intentmind-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Author Name
|
|
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,232 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: intentmind
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Language-agnostic associative memory runtime for persistent AI systems
|
|
5
|
+
Author: Intentmind Contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/avnialkan/intentmind
|
|
8
|
+
Project-URL: Repository, https://github.com/avnialkan/intentmind
|
|
9
|
+
Project-URL: Issues, https://github.com/avnialkan/intentmind/issues
|
|
10
|
+
Keywords: ai,memory,agents,rag,graph,retrieval,embeddings
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
14
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
20
|
+
Requires-Dist: pytest-cov>=4.0; extra == "dev"
|
|
21
|
+
Provides-Extra: faiss
|
|
22
|
+
Requires-Dist: faiss-cpu>=1.7.0; extra == "faiss"
|
|
23
|
+
Requires-Dist: numpy>=1.24; extra == "faiss"
|
|
24
|
+
Provides-Extra: sentence-transformers
|
|
25
|
+
Requires-Dist: sentence-transformers>=2.7.0; extra == "sentence-transformers"
|
|
26
|
+
Provides-Extra: vis
|
|
27
|
+
Requires-Dist: networkx>=3.0; extra == "vis"
|
|
28
|
+
Requires-Dist: pyvis>=0.3.2; extra == "vis"
|
|
29
|
+
Provides-Extra: langchain
|
|
30
|
+
Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
|
|
31
|
+
Provides-Extra: llm
|
|
32
|
+
Requires-Dist: openai>=1.0.0; extra == "llm"
|
|
33
|
+
Requires-Dist: python-dotenv>=1.0.0; extra == "llm"
|
|
34
|
+
Provides-Extra: api
|
|
35
|
+
Requires-Dist: fastapi>=0.110.0; extra == "api"
|
|
36
|
+
Requires-Dist: uvicorn[standard]>=0.29.0; extra == "api"
|
|
37
|
+
Requires-Dist: openai>=1.0.0; extra == "api"
|
|
38
|
+
Requires-Dist: python-dotenv>=1.0.0; extra == "api"
|
|
39
|
+
Requires-Dist: sentence-transformers>=2.7.0; extra == "api"
|
|
40
|
+
Requires-Dist: faiss-cpu>=1.7.0; extra == "api"
|
|
41
|
+
Requires-Dist: numpy>=1.24; extra == "api"
|
|
42
|
+
Provides-Extra: benchmark
|
|
43
|
+
Requires-Dist: tqdm>=4.66.0; extra == "benchmark"
|
|
44
|
+
Requires-Dist: openai>=1.0.0; extra == "benchmark"
|
|
45
|
+
Requires-Dist: python-dotenv>=1.0.0; extra == "benchmark"
|
|
46
|
+
Provides-Extra: all
|
|
47
|
+
Requires-Dist: sentence-transformers>=2.7.0; extra == "all"
|
|
48
|
+
Requires-Dist: networkx>=3.0; extra == "all"
|
|
49
|
+
Requires-Dist: pyvis>=0.3.2; extra == "all"
|
|
50
|
+
Requires-Dist: langchain-core>=0.1.0; extra == "all"
|
|
51
|
+
Requires-Dist: faiss-cpu>=1.7.0; extra == "all"
|
|
52
|
+
Requires-Dist: numpy>=1.24; extra == "all"
|
|
53
|
+
Requires-Dist: openai>=1.0.0; extra == "all"
|
|
54
|
+
Requires-Dist: python-dotenv>=1.0.0; extra == "all"
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
|
|
57
|
+
# Intentmind
|
|
58
|
+
|
|
59
|
+
Intentmind is a lightweight associative memory runtime for AI assistants and
|
|
60
|
+
agent systems. It stores memories as chunks, extracts intent nodes, connects
|
|
61
|
+
co-occurring intents in a graph, and retrieves context through a mix of direct
|
|
62
|
+
semantic match and graph traversal.
|
|
63
|
+
|
|
64
|
+
The goal is to surface relevant context that a plain top-k vector search can
|
|
65
|
+
miss when the user mentions a related concept instead of the exact old fact.
|
|
66
|
+
|
|
67
|
+
## What It Is
|
|
68
|
+
|
|
69
|
+
- A Python memory layer for LLM apps, assistants, copilots, and experiments.
|
|
70
|
+
- A graph-backed recall runtime with explainable paths such as
|
|
71
|
+
`car -> insurance`.
|
|
72
|
+
- A small library API: `add`, `query`, `save`, `load`, `tick`,
|
|
73
|
+
`graph_summary`, and `visualize`.
|
|
74
|
+
- Optional integrations for FAISS, SentenceTransformers, LangChain, and a demo
|
|
75
|
+
FastAPI/React chat UI.
|
|
76
|
+
|
|
77
|
+
Intentmind is not a full agent framework, vector database, hosted service, or
|
|
78
|
+
chatbot by itself.
|
|
79
|
+
|
|
80
|
+
## Quick Start
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
pip install -e ".[dev]"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from intentmind import IntentmindMemory
|
|
88
|
+
|
|
89
|
+
mem = IntentmindMemory(is_test=True)
|
|
90
|
+
|
|
91
|
+
mem.add("I need car insurance but I have no money.")
|
|
92
|
+
mem.add("I bought a new car and will drive to London.")
|
|
93
|
+
|
|
94
|
+
result = mem.query("I have a car and I am going to London.")
|
|
95
|
+
|
|
96
|
+
for item in result["memories"]["items"]:
|
|
97
|
+
print(item["layer"], item["intent"], item["path"], item["text"])
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
For production embeddings:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
pip install -e ".[sentence-transformers]"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
```python
|
|
107
|
+
from intentmind import IntentmindMemory
|
|
108
|
+
from intentmind.embeddings import SentenceTransformerEmbedder
|
|
109
|
+
|
|
110
|
+
mem = IntentmindMemory(embedder=SentenceTransformerEmbedder())
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Optional Features
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
pip install -e ".[faiss]" # FAISS-backed intent index
|
|
117
|
+
pip install -e ".[langchain]" # LangChain retriever adapter
|
|
118
|
+
pip install -e ".[vis]" # graph visualization
|
|
119
|
+
pip install -e ".[llm]" # OpenAI-backed intent extraction examples
|
|
120
|
+
pip install -e ".[api]" # FastAPI demo backend dependencies
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
If you use OpenAI-backed examples or the demo API, create a local `.env` from
|
|
124
|
+
`.env.example` and set `OPENAI_API_KEY`.
|
|
125
|
+
|
|
126
|
+
## Core API
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
chunk_id = mem.add("The car insurance expires next week.", source="user")
|
|
130
|
+
result = mem.query("I am planning a road trip.")
|
|
131
|
+
|
|
132
|
+
print(result["prompt"])
|
|
133
|
+
print(result["memories"]["items"])
|
|
134
|
+
print(result["trace"])
|
|
135
|
+
print(result["cognitive_field"])
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Each accepted memory item includes the chunk text, score, layer, triggering
|
|
139
|
+
intent, path, reason, and edge metadata when the item was reached through the
|
|
140
|
+
graph.
|
|
141
|
+
|
|
142
|
+
## How Recall Works
|
|
143
|
+
|
|
144
|
+
1. `add()` embeds the memory chunk and extracts candidate intents.
|
|
145
|
+
2. Intents are reused or created, then co-occurrence edges are reinforced.
|
|
146
|
+
3. `query()` extracts query intents, activates matching graph nodes, and runs a
|
|
147
|
+
query-time cognitive field step.
|
|
148
|
+
4. Recall selects direct memories, one-hop associated memories, and optional
|
|
149
|
+
weak echo memories.
|
|
150
|
+
5. `PromptBuilder` assembles an LLM-ready prompt with relevant memories and
|
|
151
|
+
traceable context.
|
|
152
|
+
|
|
153
|
+
## Persistence
|
|
154
|
+
|
|
155
|
+
```python
|
|
156
|
+
mem.save("memory_snapshot.json")
|
|
157
|
+
restored = IntentmindMemory.load("memory_snapshot.json", is_test=True)
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Generated memory snapshots are ignored by default so local experiments do not
|
|
161
|
+
leak into the repository.
|
|
162
|
+
|
|
163
|
+
## LangChain Adapter
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
from intentmind import IntentmindMemory
|
|
167
|
+
from intentmind.integrations.langchain import IntentmindRetriever
|
|
168
|
+
|
|
169
|
+
memory = IntentmindMemory(is_test=True)
|
|
170
|
+
retriever = IntentmindRetriever(memory=memory)
|
|
171
|
+
docs = retriever.invoke("How does the energy model work?")
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Demo API And UI
|
|
175
|
+
|
|
176
|
+
Backend:
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
pip install -e ".[api]"
|
|
180
|
+
$env:PYTHONPATH="src"; python api.py
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
UI:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
cd ui
|
|
187
|
+
npm install
|
|
188
|
+
npm run dev
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
The UI expects `POST /api/chat` to be reachable from the same origin or through
|
|
192
|
+
a local proxy.
|
|
193
|
+
|
|
194
|
+
## Benchmarks
|
|
195
|
+
|
|
196
|
+
Benchmark fixtures live under `tests/fixtures`. They are useful for regression
|
|
197
|
+
testing and local comparison against a classic vector-search baseline, but they
|
|
198
|
+
should not be treated as independent research claims.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
$env:PYTHONPATH="src"; python examples/run_benchmark.py
|
|
202
|
+
$env:PYTHONPATH="src"; python examples/run_real_world_benchmark.py
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Generated benchmark outputs are ignored by Git.
|
|
206
|
+
|
|
207
|
+
## Development
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
$env:PYTHONPATH="src"; python -m pytest -q
|
|
211
|
+
cd ui
|
|
212
|
+
npm install
|
|
213
|
+
npm run lint
|
|
214
|
+
npm run build
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
Current local verification: `26 passed`; UI lint and production build pass.
|
|
218
|
+
|
|
219
|
+
## Repository Layout
|
|
220
|
+
|
|
221
|
+
```text
|
|
222
|
+
src/intentmind/ Python package
|
|
223
|
+
tests/ Unit and regression tests
|
|
224
|
+
tests/fixtures/ Deterministic benchmark fixtures
|
|
225
|
+
examples/ Usage demos and benchmark runners
|
|
226
|
+
ui/ Optional React/Vite demo
|
|
227
|
+
api.py Optional FastAPI demo backend
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
## License
|
|
231
|
+
|
|
232
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# Intentmind
|
|
2
|
+
|
|
3
|
+
Intentmind is a lightweight associative memory runtime for AI assistants and
|
|
4
|
+
agent systems. It stores memories as chunks, extracts intent nodes, connects
|
|
5
|
+
co-occurring intents in a graph, and retrieves context through a mix of direct
|
|
6
|
+
semantic match and graph traversal.
|
|
7
|
+
|
|
8
|
+
The goal is to surface relevant context that a plain top-k vector search can
|
|
9
|
+
miss when the user mentions a related concept instead of the exact old fact.
|
|
10
|
+
|
|
11
|
+
## What It Is
|
|
12
|
+
|
|
13
|
+
- A Python memory layer for LLM apps, assistants, copilots, and experiments.
|
|
14
|
+
- A graph-backed recall runtime with explainable paths such as
|
|
15
|
+
`car -> insurance`.
|
|
16
|
+
- A small library API: `add`, `query`, `save`, `load`, `tick`,
|
|
17
|
+
`graph_summary`, and `visualize`.
|
|
18
|
+
- Optional integrations for FAISS, SentenceTransformers, LangChain, and a demo
|
|
19
|
+
FastAPI/React chat UI.
|
|
20
|
+
|
|
21
|
+
Intentmind is not a full agent framework, vector database, hosted service, or
|
|
22
|
+
chatbot by itself.
|
|
23
|
+
|
|
24
|
+
## Quick Start
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install -e ".[dev]"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```python
|
|
31
|
+
from intentmind import IntentmindMemory
|
|
32
|
+
|
|
33
|
+
mem = IntentmindMemory(is_test=True)
|
|
34
|
+
|
|
35
|
+
mem.add("I need car insurance but I have no money.")
|
|
36
|
+
mem.add("I bought a new car and will drive to London.")
|
|
37
|
+
|
|
38
|
+
result = mem.query("I have a car and I am going to London.")
|
|
39
|
+
|
|
40
|
+
for item in result["memories"]["items"]:
|
|
41
|
+
print(item["layer"], item["intent"], item["path"], item["text"])
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
For production embeddings:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
pip install -e ".[sentence-transformers]"
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
```python
|
|
51
|
+
from intentmind import IntentmindMemory
|
|
52
|
+
from intentmind.embeddings import SentenceTransformerEmbedder
|
|
53
|
+
|
|
54
|
+
mem = IntentmindMemory(embedder=SentenceTransformerEmbedder())
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Optional Features
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pip install -e ".[faiss]" # FAISS-backed intent index
|
|
61
|
+
pip install -e ".[langchain]" # LangChain retriever adapter
|
|
62
|
+
pip install -e ".[vis]" # graph visualization
|
|
63
|
+
pip install -e ".[llm]" # OpenAI-backed intent extraction examples
|
|
64
|
+
pip install -e ".[api]" # FastAPI demo backend dependencies
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
If you use OpenAI-backed examples or the demo API, create a local `.env` from
|
|
68
|
+
`.env.example` and set `OPENAI_API_KEY`.
|
|
69
|
+
|
|
70
|
+
## Core API
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
chunk_id = mem.add("The car insurance expires next week.", source="user")
|
|
74
|
+
result = mem.query("I am planning a road trip.")
|
|
75
|
+
|
|
76
|
+
print(result["prompt"])
|
|
77
|
+
print(result["memories"]["items"])
|
|
78
|
+
print(result["trace"])
|
|
79
|
+
print(result["cognitive_field"])
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Each accepted memory item includes the chunk text, score, layer, triggering
|
|
83
|
+
intent, path, reason, and edge metadata when the item was reached through the
|
|
84
|
+
graph.
|
|
85
|
+
|
|
86
|
+
## How Recall Works
|
|
87
|
+
|
|
88
|
+
1. `add()` embeds the memory chunk and extracts candidate intents.
|
|
89
|
+
2. Intents are reused or created, then co-occurrence edges are reinforced.
|
|
90
|
+
3. `query()` extracts query intents, activates matching graph nodes, and runs a
|
|
91
|
+
query-time cognitive field step.
|
|
92
|
+
4. Recall selects direct memories, one-hop associated memories, and optional
|
|
93
|
+
weak echo memories.
|
|
94
|
+
5. `PromptBuilder` assembles an LLM-ready prompt with relevant memories and
|
|
95
|
+
traceable context.
|
|
96
|
+
|
|
97
|
+
## Persistence
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
mem.save("memory_snapshot.json")
|
|
101
|
+
restored = IntentmindMemory.load("memory_snapshot.json", is_test=True)
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Generated memory snapshots are ignored by default so local experiments do not
|
|
105
|
+
leak into the repository.
|
|
106
|
+
|
|
107
|
+
## LangChain Adapter
|
|
108
|
+
|
|
109
|
+
```python
|
|
110
|
+
from intentmind import IntentmindMemory
|
|
111
|
+
from intentmind.integrations.langchain import IntentmindRetriever
|
|
112
|
+
|
|
113
|
+
memory = IntentmindMemory(is_test=True)
|
|
114
|
+
retriever = IntentmindRetriever(memory=memory)
|
|
115
|
+
docs = retriever.invoke("How does the energy model work?")
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Demo API And UI
|
|
119
|
+
|
|
120
|
+
Backend:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
pip install -e ".[api]"
|
|
124
|
+
$env:PYTHONPATH="src"; python api.py
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
UI:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
cd ui
|
|
131
|
+
npm install
|
|
132
|
+
npm run dev
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
The UI expects `POST /api/chat` to be reachable from the same origin or through
|
|
136
|
+
a local proxy.
|
|
137
|
+
|
|
138
|
+
## Benchmarks
|
|
139
|
+
|
|
140
|
+
Benchmark fixtures live under `tests/fixtures`. They are useful for regression
|
|
141
|
+
testing and local comparison against a classic vector-search baseline, but they
|
|
142
|
+
should not be treated as independent research claims.
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
$env:PYTHONPATH="src"; python examples/run_benchmark.py
|
|
146
|
+
$env:PYTHONPATH="src"; python examples/run_real_world_benchmark.py
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Generated benchmark outputs are ignored by Git.
|
|
150
|
+
|
|
151
|
+
## Development
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
$env:PYTHONPATH="src"; python -m pytest -q
|
|
155
|
+
cd ui
|
|
156
|
+
npm install
|
|
157
|
+
npm run lint
|
|
158
|
+
npm run build
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Current local verification: `26 passed`; UI lint and production build pass.
|
|
162
|
+
|
|
163
|
+
## Repository Layout
|
|
164
|
+
|
|
165
|
+
```text
|
|
166
|
+
src/intentmind/ Python package
|
|
167
|
+
tests/ Unit and regression tests
|
|
168
|
+
tests/fixtures/ Deterministic benchmark fixtures
|
|
169
|
+
examples/ Usage demos and benchmark runners
|
|
170
|
+
ui/ Optional React/Vite demo
|
|
171
|
+
api.py Optional FastAPI demo backend
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "intentmind"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Language-agnostic associative memory runtime for persistent AI systems"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Intentmind Contributors" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["ai", "memory", "agents", "rag", "graph", "retrieval", "embeddings"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Programming Language :: Python :: 3",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
20
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
21
|
+
]
|
|
22
|
+
|
|
23
|
+
[project.urls]
|
|
24
|
+
Homepage = "https://github.com/avnialkan/intentmind"
|
|
25
|
+
Repository = "https://github.com/avnialkan/intentmind"
|
|
26
|
+
Issues = "https://github.com/avnialkan/intentmind/issues"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.packages.find]
|
|
29
|
+
where = ["src"]
|
|
30
|
+
|
|
31
|
+
[project.optional-dependencies]
|
|
32
|
+
dev = [
|
|
33
|
+
"pytest>=7.0",
|
|
34
|
+
"pytest-cov>=4.0",
|
|
35
|
+
]
|
|
36
|
+
faiss = [
|
|
37
|
+
"faiss-cpu>=1.7.0",
|
|
38
|
+
"numpy>=1.24",
|
|
39
|
+
]
|
|
40
|
+
sentence-transformers = ["sentence-transformers>=2.7.0"]
|
|
41
|
+
vis = ["networkx>=3.0", "pyvis>=0.3.2"]
|
|
42
|
+
langchain = ["langchain-core>=0.1.0"]
|
|
43
|
+
llm = ["openai>=1.0.0", "python-dotenv>=1.0.0"]
|
|
44
|
+
api = [
|
|
45
|
+
"fastapi>=0.110.0",
|
|
46
|
+
"uvicorn[standard]>=0.29.0",
|
|
47
|
+
"openai>=1.0.0",
|
|
48
|
+
"python-dotenv>=1.0.0",
|
|
49
|
+
"sentence-transformers>=2.7.0",
|
|
50
|
+
"faiss-cpu>=1.7.0",
|
|
51
|
+
"numpy>=1.24",
|
|
52
|
+
]
|
|
53
|
+
benchmark = ["tqdm>=4.66.0", "openai>=1.0.0", "python-dotenv>=1.0.0"]
|
|
54
|
+
all = [
|
|
55
|
+
"sentence-transformers>=2.7.0",
|
|
56
|
+
"networkx>=3.0",
|
|
57
|
+
"pyvis>=0.3.2",
|
|
58
|
+
"langchain-core>=0.1.0",
|
|
59
|
+
"faiss-cpu>=1.7.0",
|
|
60
|
+
"numpy>=1.24",
|
|
61
|
+
"openai>=1.0.0",
|
|
62
|
+
"python-dotenv>=1.0.0",
|
|
63
|
+
]
|