hermes-ai-know 0.3.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.
- hermes_ai_know-0.3.0/PKG-INFO +103 -0
- hermes_ai_know-0.3.0/README.md +92 -0
- hermes_ai_know-0.3.0/ai_know/__init__.py +3 -0
- hermes_ai_know-0.3.0/ai_know/adapters/__init__.py +25 -0
- hermes_ai_know-0.3.0/ai_know/adapters/hermes.py +509 -0
- hermes_ai_know-0.3.0/ai_know/api/__init__.py +1 -0
- hermes_ai_know-0.3.0/ai_know/api/context.py +46 -0
- hermes_ai_know-0.3.0/ai_know/api/dream.py +123 -0
- hermes_ai_know-0.3.0/ai_know/api/episodes.py +154 -0
- hermes_ai_know-0.3.0/ai_know/api/events.py +112 -0
- hermes_ai_know-0.3.0/ai_know/api/feedback.py +50 -0
- hermes_ai_know-0.3.0/ai_know/api/goals.py +199 -0
- hermes_ai_know-0.3.0/ai_know/api/health.py +102 -0
- hermes_ai_know-0.3.0/ai_know/api/identity.py +79 -0
- hermes_ai_know-0.3.0/ai_know/api/memories.py +259 -0
- hermes_ai_know-0.3.0/ai_know/config.py +125 -0
- hermes_ai_know-0.3.0/ai_know/core/__init__.py +5 -0
- hermes_ai_know-0.3.0/ai_know/core/arbitrator.py +472 -0
- hermes_ai_know-0.3.0/ai_know/core/claim_extractor.py +657 -0
- hermes_ai_know-0.3.0/ai_know/core/dream_engine.py +458 -0
- hermes_ai_know-0.3.0/ai_know/core/episode_builder.py +247 -0
- hermes_ai_know-0.3.0/ai_know/core/event_ingestor.py +197 -0
- hermes_ai_know-0.3.0/ai_know/core/feedback_engine.py +334 -0
- hermes_ai_know-0.3.0/ai_know/core/identity_builder.py +143 -0
- hermes_ai_know-0.3.0/ai_know/core/pack_builder/__init__.py +19 -0
- hermes_ai_know-0.3.0/ai_know/core/pack_builder/builder.py +418 -0
- hermes_ai_know-0.3.0/ai_know/core/pack_builder/composer.py +268 -0
- hermes_ai_know-0.3.0/ai_know/core/pack_builder/goal_resolver.py +64 -0
- hermes_ai_know-0.3.0/ai_know/core/pack_builder/privacy_filter.py +84 -0
- hermes_ai_know-0.3.0/ai_know/core/pack_builder/ranking.py +270 -0
- hermes_ai_know-0.3.0/ai_know/core/pack_builder/scope_filter.py +70 -0
- hermes_ai_know-0.3.0/ai_know/db/__init__.py +1 -0
- hermes_ai_know-0.3.0/ai_know/db/models.py +486 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/__init__.py +34 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/agent_permissions.py +28 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/context_pack_runs.py +37 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/episodes.py +37 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/events.py +122 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/goals.py +35 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/memory_claims.py +44 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/memory_evidence.py +31 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/memory_feedback.py +84 -0
- hermes_ai_know-0.3.0/ai_know/db/repositories/memory_objects.py +65 -0
- hermes_ai_know-0.3.0/ai_know/db/session.py +80 -0
- hermes_ai_know-0.3.0/ai_know/jobs/__init__.py +4 -0
- hermes_ai_know-0.3.0/ai_know/jobs/scheduler.py +183 -0
- hermes_ai_know-0.3.0/ai_know/main.py +123 -0
- hermes_ai_know-0.3.0/ai_know/mcp/__init__.py +34 -0
- hermes_ai_know-0.3.0/ai_know/mcp/mount.py +46 -0
- hermes_ai_know-0.3.0/ai_know/mcp/server.py +257 -0
- hermes_ai_know-0.3.0/ai_know/providers/__init__.py +5 -0
- hermes_ai_know-0.3.0/ai_know/providers/embeddings/__init__.py +13 -0
- hermes_ai_know-0.3.0/ai_know/providers/embeddings/ark.py +173 -0
- hermes_ai_know-0.3.0/ai_know/providers/embeddings/base.py +33 -0
- hermes_ai_know-0.3.0/ai_know/providers/embeddings/factory.py +82 -0
- hermes_ai_know-0.3.0/ai_know/providers/embeddings/fake.py +148 -0
- hermes_ai_know-0.3.0/ai_know/providers/llm/__init__.py +21 -0
- hermes_ai_know-0.3.0/ai_know/providers/llm/ark.py +165 -0
- hermes_ai_know-0.3.0/ai_know/providers/llm/base.py +57 -0
- hermes_ai_know-0.3.0/ai_know/providers/llm/factory.py +70 -0
- hermes_ai_know-0.3.0/ai_know/providers/llm/fake.py +75 -0
- hermes_ai_know-0.3.0/ai_know/schemas/__init__.py +6 -0
- hermes_ai_know-0.3.0/ai_know/schemas/consolidate.py +74 -0
- hermes_ai_know-0.3.0/ai_know/schemas/context.py +169 -0
- hermes_ai_know-0.3.0/ai_know/schemas/dream.py +57 -0
- hermes_ai_know-0.3.0/ai_know/schemas/episodes.py +71 -0
- hermes_ai_know-0.3.0/ai_know/schemas/event.py +96 -0
- hermes_ai_know-0.3.0/ai_know/schemas/feedback.py +78 -0
- hermes_ai_know-0.3.0/ai_know/schemas/goals.py +74 -0
- hermes_ai_know-0.3.0/ai_know/schemas/identity.py +64 -0
- hermes_ai_know-0.3.0/ai_know/schemas/memories.py +101 -0
- hermes_ai_know-0.3.0/hermes_ai_know.egg-info/PKG-INFO +103 -0
- hermes_ai_know-0.3.0/hermes_ai_know.egg-info/SOURCES.txt +75 -0
- hermes_ai_know-0.3.0/hermes_ai_know.egg-info/dependency_links.txt +1 -0
- hermes_ai_know-0.3.0/hermes_ai_know.egg-info/top_level.txt +1 -0
- hermes_ai_know-0.3.0/pyproject.toml +49 -0
- hermes_ai_know-0.3.0/setup.cfg +4 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hermes-ai-know
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: AI KNOW - Memory Kernel for long-running AI agents (Hermes ecosystem)
|
|
5
|
+
Author: ASMAS
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Source, https://github.com/asmas-ai/ai-know
|
|
8
|
+
Project-URL: Blueprint, https://github.com/asmas-ai/ai-know/blob/main/docs/ENGINEERING_UPGRADE_BLUEPRINT.md
|
|
9
|
+
Requires-Python: >=3.11
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
|
|
12
|
+
# AI KNOW - Python MVP
|
|
13
|
+
|
|
14
|
+
Python 3.11 + FastAPI implementation of the AI KNOW Memory Kernel v0.1.
|
|
15
|
+
This is the **primary execution path** for v0.1; the Rust code under
|
|
16
|
+
`src/backend/memory-core/` is retained as a reference implementation.
|
|
17
|
+
|
|
18
|
+
## Layout
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
python-mvp/
|
|
22
|
+
├── ai_know/
|
|
23
|
+
│ ├── main.py # FastAPI app factory
|
|
24
|
+
│ ├── config.py # Pydantic Settings (env-driven)
|
|
25
|
+
│ ├── api/ # HTTP routers (health, events, memories, ...)
|
|
26
|
+
│ ├── core/ # Ingestor, extractor, arbitrator, ... (PR 3+)
|
|
27
|
+
│ ├── db/ # SQLAlchemy models + repositories (PR 2)
|
|
28
|
+
│ ├── schemas/ # Pydantic request/response schemas (PR 3+)
|
|
29
|
+
│ ├── providers/ # Embedding + LLM providers (PR 4+)
|
|
30
|
+
│ └── jobs/ # Background jobs (dream, consolidation) (PR 7+)
|
|
31
|
+
├── migrations/ # Alembic (PR 2)
|
|
32
|
+
├── tests/
|
|
33
|
+
│ ├── unit/ # No I/O
|
|
34
|
+
│ ├── integration/ # Needs Postgres / Redis (PR 2+)
|
|
35
|
+
│ └── evals/ # Mini evals (PR 8)
|
|
36
|
+
├── requirements.txt
|
|
37
|
+
├── pyproject.toml
|
|
38
|
+
├── Dockerfile
|
|
39
|
+
└── README.md
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Quick start
|
|
43
|
+
|
|
44
|
+
From the ai-know repo root:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
docker compose up --build
|
|
48
|
+
# One-shot: apply the schema.
|
|
49
|
+
docker compose exec api alembic upgrade head
|
|
50
|
+
curl http://localhost:8090/health
|
|
51
|
+
# → {"status":"ok","version":"0.1.0","environment":"dev"}
|
|
52
|
+
curl http://localhost:8090/health/ready
|
|
53
|
+
# → {"status":"ok",...,"database":"ok","redis":"ok"}
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Host ports: **API 8090, Postgres 5433, Redis 6380** (they coexist with
|
|
57
|
+
Hermes on 8080/5432 and Claudio on 3001).
|
|
58
|
+
|
|
59
|
+
## Local dev (no Docker)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cd src/backend/python-mvp
|
|
63
|
+
python3.11 -m venv .venv
|
|
64
|
+
source .venv/bin/activate
|
|
65
|
+
pip install -r requirements.txt
|
|
66
|
+
export DATABASE_URL=postgresql+psycopg://ai_know:ai_know_dev@localhost:5433/ai_know
|
|
67
|
+
export REDIS_URL=redis://localhost:6380/0
|
|
68
|
+
alembic upgrade head
|
|
69
|
+
uvicorn ai_know.main:app --reload --port 8080
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## Tests
|
|
73
|
+
|
|
74
|
+
Unit only (no I/O):
|
|
75
|
+
```bash
|
|
76
|
+
pytest tests/unit -v
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Integration (needs docker compose up):
|
|
80
|
+
```bash
|
|
81
|
+
# From inside the running api container:
|
|
82
|
+
docker compose exec api python -m pytest tests/integration -v
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## PR status (as of v0.1.0 tag)
|
|
86
|
+
|
|
87
|
+
| PR | Scope | Status | Tests |
|
|
88
|
+
| -- | -------------------------------- | ------ | ------- |
|
|
89
|
+
| 1 | scaffold / FastAPI / health | ✅ done | – |
|
|
90
|
+
| 2 | DB migrations (9 tables + repos) | ✅ done | 14/14 |
|
|
91
|
+
| 3 | Events API | ✅ done | 44/44 |
|
|
92
|
+
| 4 | Episode + Claim extraction | ✅ done | 82/82 |
|
|
93
|
+
| 5 | Arbitration + consolidation | ✅ done | 109/109 |
|
|
94
|
+
| 6 | Context Pack builder | ✅ done | 149/149 |
|
|
95
|
+
| 7 | Feedback engine | ✅ done | 174/174 |
|
|
96
|
+
| 8 | Mini evals | ✅ done | 178/178 |
|
|
97
|
+
| 9 | Hermes adapter (dogfooding) | ✅ done | 187/187 |
|
|
98
|
+
| 10 | v0.1 release polish | ✅ done | 187/187 |
|
|
99
|
+
|
|
100
|
+
**v0.1 backend RELEASE-READY.** See the top-level [CHANGELOG.md](../../../CHANGELOG.md)
|
|
101
|
+
for landing dates and commits. See [`ai_know/adapters/hermes.py`](./ai_know/adapters/hermes.py)
|
|
102
|
+
for the client-side SDK that lets hermes-agent (and any other host) talk
|
|
103
|
+
to this backend without reimplementing the wire contract.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# AI KNOW - Python MVP
|
|
2
|
+
|
|
3
|
+
Python 3.11 + FastAPI implementation of the AI KNOW Memory Kernel v0.1.
|
|
4
|
+
This is the **primary execution path** for v0.1; the Rust code under
|
|
5
|
+
`src/backend/memory-core/` is retained as a reference implementation.
|
|
6
|
+
|
|
7
|
+
## Layout
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
python-mvp/
|
|
11
|
+
├── ai_know/
|
|
12
|
+
│ ├── main.py # FastAPI app factory
|
|
13
|
+
│ ├── config.py # Pydantic Settings (env-driven)
|
|
14
|
+
│ ├── api/ # HTTP routers (health, events, memories, ...)
|
|
15
|
+
│ ├── core/ # Ingestor, extractor, arbitrator, ... (PR 3+)
|
|
16
|
+
│ ├── db/ # SQLAlchemy models + repositories (PR 2)
|
|
17
|
+
│ ├── schemas/ # Pydantic request/response schemas (PR 3+)
|
|
18
|
+
│ ├── providers/ # Embedding + LLM providers (PR 4+)
|
|
19
|
+
│ └── jobs/ # Background jobs (dream, consolidation) (PR 7+)
|
|
20
|
+
├── migrations/ # Alembic (PR 2)
|
|
21
|
+
├── tests/
|
|
22
|
+
│ ├── unit/ # No I/O
|
|
23
|
+
│ ├── integration/ # Needs Postgres / Redis (PR 2+)
|
|
24
|
+
│ └── evals/ # Mini evals (PR 8)
|
|
25
|
+
├── requirements.txt
|
|
26
|
+
├── pyproject.toml
|
|
27
|
+
├── Dockerfile
|
|
28
|
+
└── README.md
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Quick start
|
|
32
|
+
|
|
33
|
+
From the ai-know repo root:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
docker compose up --build
|
|
37
|
+
# One-shot: apply the schema.
|
|
38
|
+
docker compose exec api alembic upgrade head
|
|
39
|
+
curl http://localhost:8090/health
|
|
40
|
+
# → {"status":"ok","version":"0.1.0","environment":"dev"}
|
|
41
|
+
curl http://localhost:8090/health/ready
|
|
42
|
+
# → {"status":"ok",...,"database":"ok","redis":"ok"}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Host ports: **API 8090, Postgres 5433, Redis 6380** (they coexist with
|
|
46
|
+
Hermes on 8080/5432 and Claudio on 3001).
|
|
47
|
+
|
|
48
|
+
## Local dev (no Docker)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cd src/backend/python-mvp
|
|
52
|
+
python3.11 -m venv .venv
|
|
53
|
+
source .venv/bin/activate
|
|
54
|
+
pip install -r requirements.txt
|
|
55
|
+
export DATABASE_URL=postgresql+psycopg://ai_know:ai_know_dev@localhost:5433/ai_know
|
|
56
|
+
export REDIS_URL=redis://localhost:6380/0
|
|
57
|
+
alembic upgrade head
|
|
58
|
+
uvicorn ai_know.main:app --reload --port 8080
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Tests
|
|
62
|
+
|
|
63
|
+
Unit only (no I/O):
|
|
64
|
+
```bash
|
|
65
|
+
pytest tests/unit -v
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Integration (needs docker compose up):
|
|
69
|
+
```bash
|
|
70
|
+
# From inside the running api container:
|
|
71
|
+
docker compose exec api python -m pytest tests/integration -v
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## PR status (as of v0.1.0 tag)
|
|
75
|
+
|
|
76
|
+
| PR | Scope | Status | Tests |
|
|
77
|
+
| -- | -------------------------------- | ------ | ------- |
|
|
78
|
+
| 1 | scaffold / FastAPI / health | ✅ done | – |
|
|
79
|
+
| 2 | DB migrations (9 tables + repos) | ✅ done | 14/14 |
|
|
80
|
+
| 3 | Events API | ✅ done | 44/44 |
|
|
81
|
+
| 4 | Episode + Claim extraction | ✅ done | 82/82 |
|
|
82
|
+
| 5 | Arbitration + consolidation | ✅ done | 109/109 |
|
|
83
|
+
| 6 | Context Pack builder | ✅ done | 149/149 |
|
|
84
|
+
| 7 | Feedback engine | ✅ done | 174/174 |
|
|
85
|
+
| 8 | Mini evals | ✅ done | 178/178 |
|
|
86
|
+
| 9 | Hermes adapter (dogfooding) | ✅ done | 187/187 |
|
|
87
|
+
| 10 | v0.1 release polish | ✅ done | 187/187 |
|
|
88
|
+
|
|
89
|
+
**v0.1 backend RELEASE-READY.** See the top-level [CHANGELOG.md](../../../CHANGELOG.md)
|
|
90
|
+
for landing dates and commits. See [`ai_know/adapters/hermes.py`](./ai_know/adapters/hermes.py)
|
|
91
|
+
for the client-side SDK that lets hermes-agent (and any other host) talk
|
|
92
|
+
to this backend without reimplementing the wire contract.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""Client-side adapters that let external agents talk to AI KNOW.
|
|
2
|
+
|
|
3
|
+
Adapters live in the AI KNOW repo (not in each agent's codebase) so:
|
|
4
|
+
1. We can unit-test the wire contract in-process with FastAPI's
|
|
5
|
+
TestClient — no cross-repo dev loop needed.
|
|
6
|
+
2. Every agent gets the same auto-degrade + timeout semantics for
|
|
7
|
+
free; we don't reinvent them per integration.
|
|
8
|
+
3. If the wire contract shifts, the adapter shifts with it in the
|
|
9
|
+
same PR — no drift.
|
|
10
|
+
|
|
11
|
+
v0.1 ships one adapter: :class:`AIKnowHermesAdapter` (see ``hermes.py``),
|
|
12
|
+
targeting upstream NousResearch/hermes-agent.
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
from .hermes import ( # noqa: F401
|
|
16
|
+
AIKnowHermesAdapter,
|
|
17
|
+
HermesSessionState,
|
|
18
|
+
AdapterConfig,
|
|
19
|
+
)
|
|
20
|
+
|
|
21
|
+
__all__ = [
|
|
22
|
+
"AIKnowHermesAdapter",
|
|
23
|
+
"HermesSessionState",
|
|
24
|
+
"AdapterConfig",
|
|
25
|
+
]
|