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.
Files changed (77) hide show
  1. hermes_ai_know-0.3.0/PKG-INFO +103 -0
  2. hermes_ai_know-0.3.0/README.md +92 -0
  3. hermes_ai_know-0.3.0/ai_know/__init__.py +3 -0
  4. hermes_ai_know-0.3.0/ai_know/adapters/__init__.py +25 -0
  5. hermes_ai_know-0.3.0/ai_know/adapters/hermes.py +509 -0
  6. hermes_ai_know-0.3.0/ai_know/api/__init__.py +1 -0
  7. hermes_ai_know-0.3.0/ai_know/api/context.py +46 -0
  8. hermes_ai_know-0.3.0/ai_know/api/dream.py +123 -0
  9. hermes_ai_know-0.3.0/ai_know/api/episodes.py +154 -0
  10. hermes_ai_know-0.3.0/ai_know/api/events.py +112 -0
  11. hermes_ai_know-0.3.0/ai_know/api/feedback.py +50 -0
  12. hermes_ai_know-0.3.0/ai_know/api/goals.py +199 -0
  13. hermes_ai_know-0.3.0/ai_know/api/health.py +102 -0
  14. hermes_ai_know-0.3.0/ai_know/api/identity.py +79 -0
  15. hermes_ai_know-0.3.0/ai_know/api/memories.py +259 -0
  16. hermes_ai_know-0.3.0/ai_know/config.py +125 -0
  17. hermes_ai_know-0.3.0/ai_know/core/__init__.py +5 -0
  18. hermes_ai_know-0.3.0/ai_know/core/arbitrator.py +472 -0
  19. hermes_ai_know-0.3.0/ai_know/core/claim_extractor.py +657 -0
  20. hermes_ai_know-0.3.0/ai_know/core/dream_engine.py +458 -0
  21. hermes_ai_know-0.3.0/ai_know/core/episode_builder.py +247 -0
  22. hermes_ai_know-0.3.0/ai_know/core/event_ingestor.py +197 -0
  23. hermes_ai_know-0.3.0/ai_know/core/feedback_engine.py +334 -0
  24. hermes_ai_know-0.3.0/ai_know/core/identity_builder.py +143 -0
  25. hermes_ai_know-0.3.0/ai_know/core/pack_builder/__init__.py +19 -0
  26. hermes_ai_know-0.3.0/ai_know/core/pack_builder/builder.py +418 -0
  27. hermes_ai_know-0.3.0/ai_know/core/pack_builder/composer.py +268 -0
  28. hermes_ai_know-0.3.0/ai_know/core/pack_builder/goal_resolver.py +64 -0
  29. hermes_ai_know-0.3.0/ai_know/core/pack_builder/privacy_filter.py +84 -0
  30. hermes_ai_know-0.3.0/ai_know/core/pack_builder/ranking.py +270 -0
  31. hermes_ai_know-0.3.0/ai_know/core/pack_builder/scope_filter.py +70 -0
  32. hermes_ai_know-0.3.0/ai_know/db/__init__.py +1 -0
  33. hermes_ai_know-0.3.0/ai_know/db/models.py +486 -0
  34. hermes_ai_know-0.3.0/ai_know/db/repositories/__init__.py +34 -0
  35. hermes_ai_know-0.3.0/ai_know/db/repositories/agent_permissions.py +28 -0
  36. hermes_ai_know-0.3.0/ai_know/db/repositories/context_pack_runs.py +37 -0
  37. hermes_ai_know-0.3.0/ai_know/db/repositories/episodes.py +37 -0
  38. hermes_ai_know-0.3.0/ai_know/db/repositories/events.py +122 -0
  39. hermes_ai_know-0.3.0/ai_know/db/repositories/goals.py +35 -0
  40. hermes_ai_know-0.3.0/ai_know/db/repositories/memory_claims.py +44 -0
  41. hermes_ai_know-0.3.0/ai_know/db/repositories/memory_evidence.py +31 -0
  42. hermes_ai_know-0.3.0/ai_know/db/repositories/memory_feedback.py +84 -0
  43. hermes_ai_know-0.3.0/ai_know/db/repositories/memory_objects.py +65 -0
  44. hermes_ai_know-0.3.0/ai_know/db/session.py +80 -0
  45. hermes_ai_know-0.3.0/ai_know/jobs/__init__.py +4 -0
  46. hermes_ai_know-0.3.0/ai_know/jobs/scheduler.py +183 -0
  47. hermes_ai_know-0.3.0/ai_know/main.py +123 -0
  48. hermes_ai_know-0.3.0/ai_know/mcp/__init__.py +34 -0
  49. hermes_ai_know-0.3.0/ai_know/mcp/mount.py +46 -0
  50. hermes_ai_know-0.3.0/ai_know/mcp/server.py +257 -0
  51. hermes_ai_know-0.3.0/ai_know/providers/__init__.py +5 -0
  52. hermes_ai_know-0.3.0/ai_know/providers/embeddings/__init__.py +13 -0
  53. hermes_ai_know-0.3.0/ai_know/providers/embeddings/ark.py +173 -0
  54. hermes_ai_know-0.3.0/ai_know/providers/embeddings/base.py +33 -0
  55. hermes_ai_know-0.3.0/ai_know/providers/embeddings/factory.py +82 -0
  56. hermes_ai_know-0.3.0/ai_know/providers/embeddings/fake.py +148 -0
  57. hermes_ai_know-0.3.0/ai_know/providers/llm/__init__.py +21 -0
  58. hermes_ai_know-0.3.0/ai_know/providers/llm/ark.py +165 -0
  59. hermes_ai_know-0.3.0/ai_know/providers/llm/base.py +57 -0
  60. hermes_ai_know-0.3.0/ai_know/providers/llm/factory.py +70 -0
  61. hermes_ai_know-0.3.0/ai_know/providers/llm/fake.py +75 -0
  62. hermes_ai_know-0.3.0/ai_know/schemas/__init__.py +6 -0
  63. hermes_ai_know-0.3.0/ai_know/schemas/consolidate.py +74 -0
  64. hermes_ai_know-0.3.0/ai_know/schemas/context.py +169 -0
  65. hermes_ai_know-0.3.0/ai_know/schemas/dream.py +57 -0
  66. hermes_ai_know-0.3.0/ai_know/schemas/episodes.py +71 -0
  67. hermes_ai_know-0.3.0/ai_know/schemas/event.py +96 -0
  68. hermes_ai_know-0.3.0/ai_know/schemas/feedback.py +78 -0
  69. hermes_ai_know-0.3.0/ai_know/schemas/goals.py +74 -0
  70. hermes_ai_know-0.3.0/ai_know/schemas/identity.py +64 -0
  71. hermes_ai_know-0.3.0/ai_know/schemas/memories.py +101 -0
  72. hermes_ai_know-0.3.0/hermes_ai_know.egg-info/PKG-INFO +103 -0
  73. hermes_ai_know-0.3.0/hermes_ai_know.egg-info/SOURCES.txt +75 -0
  74. hermes_ai_know-0.3.0/hermes_ai_know.egg-info/dependency_links.txt +1 -0
  75. hermes_ai_know-0.3.0/hermes_ai_know.egg-info/top_level.txt +1 -0
  76. hermes_ai_know-0.3.0/pyproject.toml +49 -0
  77. 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,3 @@
1
+ """AI KNOW - Memory Kernel for long-running AI agents."""
2
+
3
+ __version__ = "0.3.0"
@@ -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
+ ]