artha-engine 0.1.1__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.
- artha_engine-0.1.1/PKG-INFO +136 -0
- artha_engine-0.1.1/README.md +104 -0
- artha_engine-0.1.1/pyproject.toml +63 -0
- artha_engine-0.1.1/src/artha_engine/.DS_Store +0 -0
- artha_engine-0.1.1/src/artha_engine/__init__.py +241 -0
- artha_engine-0.1.1/src/artha_engine/app/__init__.py +71 -0
- artha_engine-0.1.1/src/artha_engine/app/actions.py +390 -0
- artha_engine-0.1.1/src/artha_engine/app/api_key_crypto.py +35 -0
- artha_engine-0.1.1/src/artha_engine/app/application.py +107 -0
- artha_engine-0.1.1/src/artha_engine/app/auth.py +195 -0
- artha_engine-0.1.1/src/artha_engine/app/authorization.py +42 -0
- artha_engine-0.1.1/src/artha_engine/app/build.py +179 -0
- artha_engine-0.1.1/src/artha_engine/app/cli.py +252 -0
- artha_engine-0.1.1/src/artha_engine/app/cli_config.py +72 -0
- artha_engine-0.1.1/src/artha_engine/app/config.py +126 -0
- artha_engine-0.1.1/src/artha_engine/app/context.py +26 -0
- artha_engine-0.1.1/src/artha_engine/app/http.py +234 -0
- artha_engine-0.1.1/src/artha_engine/app/managed_api_keys.py +224 -0
- artha_engine-0.1.1/src/artha_engine/app/mcp.py +324 -0
- artha_engine-0.1.1/src/artha_engine/app/remote_client.py +77 -0
- artha_engine-0.1.1/src/artha_engine/cli.py +380 -0
- artha_engine-0.1.1/src/artha_engine/decoders/__init__.py +79 -0
- artha_engine-0.1.1/src/artha_engine/decoders/base.py +16 -0
- artha_engine-0.1.1/src/artha_engine/decoders/core.py +122 -0
- artha_engine-0.1.1/src/artha_engine/decoders/llm.py +63 -0
- artha_engine-0.1.1/src/artha_engine/decoders/search.py +321 -0
- artha_engine-0.1.1/src/artha_engine/embeddings/__init__.py +33 -0
- artha_engine-0.1.1/src/artha_engine/embeddings/base.py +28 -0
- artha_engine-0.1.1/src/artha_engine/embeddings/deterministic.py +35 -0
- artha_engine-0.1.1/src/artha_engine/embeddings/fastembed.py +82 -0
- artha_engine-0.1.1/src/artha_engine/encoders/__init__.py +25 -0
- artha_engine-0.1.1/src/artha_engine/encoders/base.py +18 -0
- artha_engine-0.1.1/src/artha_engine/encoders/core.py +157 -0
- artha_engine-0.1.1/src/artha_engine/encoders/llm.py +57 -0
- artha_engine-0.1.1/src/artha_engine/lifecycle/__init__.py +16 -0
- artha_engine-0.1.1/src/artha_engine/lifecycle/base.py +32 -0
- artha_engine-0.1.1/src/artha_engine/lifecycle/core.py +79 -0
- artha_engine-0.1.1/src/artha_engine/llms/__init__.py +30 -0
- artha_engine-0.1.1/src/artha_engine/llms/base.py +20 -0
- artha_engine-0.1.1/src/artha_engine/llms/deterministic.py +69 -0
- artha_engine-0.1.1/src/artha_engine/llms/litellm.py +62 -0
- artha_engine-0.1.1/src/artha_engine/py.typed +0 -0
- artha_engine-0.1.1/src/artha_engine/representations/.DS_Store +0 -0
- artha_engine-0.1.1/src/artha_engine/representations/__init__.py +27 -0
- artha_engine-0.1.1/src/artha_engine/representations/arthaanu.py +102 -0
- artha_engine-0.1.1/src/artha_engine/retrieval/__init__.py +8 -0
- artha_engine-0.1.1/src/artha_engine/retrieval/bm25.py +74 -0
- artha_engine-0.1.1/src/artha_engine/retrieval/rrf.py +33 -0
- artha_engine-0.1.1/src/artha_engine/runtime/__init__.py +50 -0
- artha_engine-0.1.1/src/artha_engine/runtime/api/__init__.py +0 -0
- artha_engine-0.1.1/src/artha_engine/runtime/api/app.py +338 -0
- artha_engine-0.1.1/src/artha_engine/runtime/api/debug_context.py +22 -0
- artha_engine-0.1.1/src/artha_engine/runtime/api/schemas.py +168 -0
- artha_engine-0.1.1/src/artha_engine/runtime/auth.py +49 -0
- artha_engine-0.1.1/src/artha_engine/runtime/capabilities.py +37 -0
- artha_engine-0.1.1/src/artha_engine/runtime/component_registry.py +141 -0
- artha_engine-0.1.1/src/artha_engine/runtime/debug/__init__.py +19 -0
- artha_engine-0.1.1/src/artha_engine/runtime/debug/spans.py +122 -0
- artha_engine-0.1.1/src/artha_engine/runtime/engine.py +488 -0
- artha_engine-0.1.1/src/artha_engine/runtime/projections.py +19 -0
- artha_engine-0.1.1/src/artha_engine/runtime/registry.py +400 -0
- artha_engine-0.1.1/src/artha_engine/runtime/serde.py +16 -0
- artha_engine-0.1.1/src/artha_engine/store/__init__.py +42 -0
- artha_engine-0.1.1/src/artha_engine/store/api_key_store.py +296 -0
- artha_engine-0.1.1/src/artha_engine/store/api_keys_schema.sql +15 -0
- artha_engine-0.1.1/src/artha_engine/store/base.py +93 -0
- artha_engine-0.1.1/src/artha_engine/store/factory.py +39 -0
- artha_engine-0.1.1/src/artha_engine/store/memory.py +277 -0
- artha_engine-0.1.1/src/artha_engine/store/postgres.py +578 -0
- artha_engine-0.1.1/src/artha_engine/store/projection_sql.py +44 -0
- artha_engine-0.1.1/src/artha_engine/store/schema.sql +50 -0
- artha_engine-0.1.1/src/artha_engine/store/schema_postgres.sql +50 -0
- artha_engine-0.1.1/src/artha_engine/store/serde.py +24 -0
- artha_engine-0.1.1/src/artha_engine/store/sqlite.py +650 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: artha-engine
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Semantic memory engine with append-only event ledger, Arthaanu representations, and projection replay.
|
|
5
|
+
Keywords: memory,rag,semantic-events,projections,agents
|
|
6
|
+
Author: Alphanimble
|
|
7
|
+
Author-email: Alphanimble <rakshith.g@alphanimble.com>
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Intended Audience :: Developers
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
12
|
+
Requires-Dist: pydantic>=2.13.4
|
|
13
|
+
Requires-Dist: fastembed>=0.6.0
|
|
14
|
+
Requires-Dist: litellm>=1.60.0
|
|
15
|
+
Requires-Dist: psycopg[binary]>=3.2.0
|
|
16
|
+
Requires-Dist: fastapi>=0.115.0 ; extra == 'app'
|
|
17
|
+
Requires-Dist: uvicorn[standard]>=0.34.0 ; extra == 'app'
|
|
18
|
+
Requires-Dist: httpx>=0.28.0 ; extra == 'app'
|
|
19
|
+
Requires-Dist: pyjwt[crypto]>=2.10.0,<3 ; extra == 'auth'
|
|
20
|
+
Requires-Dist: mcp>=1.0.0,<2 ; extra == 'mcp'
|
|
21
|
+
Requires-Dist: fastapi>=0.115.0 ; extra == 'server'
|
|
22
|
+
Requires-Dist: uvicorn[standard]>=0.34.0 ; extra == 'server'
|
|
23
|
+
Requires-Dist: fastapi>=0.115.0 ; extra == 'workbench'
|
|
24
|
+
Requires-Dist: uvicorn[standard]>=0.34.0 ; extra == 'workbench'
|
|
25
|
+
Requires-Python: >=3.12
|
|
26
|
+
Provides-Extra: app
|
|
27
|
+
Provides-Extra: auth
|
|
28
|
+
Provides-Extra: mcp
|
|
29
|
+
Provides-Extra: server
|
|
30
|
+
Provides-Extra: workbench
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
|
|
33
|
+
# Artha Engine
|
|
34
|
+
|
|
35
|
+
Artha Engine is the core Python library for building Arthaanu-based memory
|
|
36
|
+
systems. It provides:
|
|
37
|
+
|
|
38
|
+
- typed Arthaanu representations
|
|
39
|
+
- encoder, lifecycle, decoder, and projection registries
|
|
40
|
+
- an append-only semantic event ledger
|
|
41
|
+
- SQLite and in-memory stores
|
|
42
|
+
- projection replay with watermarks and status
|
|
43
|
+
- typed product actions exposed as HTTP, MCP, and CLI tools
|
|
44
|
+
- Clerk/JWT/API-key authentication adapters
|
|
45
|
+
- portable OCI application builds
|
|
46
|
+
- a small `artha` CLI for inspection and local operation
|
|
47
|
+
|
|
48
|
+
The engine is intentionally small. Product-specific memory types, profiles,
|
|
49
|
+
retrieval policy, and domain projections should usually live in userland
|
|
50
|
+
packages built on top of the engine.
|
|
51
|
+
|
|
52
|
+
## Install Locally
|
|
53
|
+
|
|
54
|
+
From this repository:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
cd artha_engine
|
|
58
|
+
uv sync
|
|
59
|
+
uv run artha doctor
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
To run the FastAPI runtime:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
uv sync --extra server
|
|
66
|
+
uv run artha serve --port 8765
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Create product actions with one typed declaration:
|
|
70
|
+
|
|
71
|
+
```python
|
|
72
|
+
@actions.action(
|
|
73
|
+
name="memory.search",
|
|
74
|
+
http=("POST", "/memories/search"),
|
|
75
|
+
mcp=True,
|
|
76
|
+
cli="memory search",
|
|
77
|
+
scopes=["memory:read"],
|
|
78
|
+
)
|
|
79
|
+
def search(input: SearchInput, context: ActionContext) -> SearchOutput:
|
|
80
|
+
...
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## CLI
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
artha doctor
|
|
87
|
+
artha registry
|
|
88
|
+
artha encode text --input "Artha keeps semantic events canonical."
|
|
89
|
+
artha events --limit 5
|
|
90
|
+
artha objects --limit 5
|
|
91
|
+
artha projections
|
|
92
|
+
artha check
|
|
93
|
+
artha build
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Use `--db path/to/artha.db` to point commands at a specific SQLite ledger.
|
|
97
|
+
Most commands support `--json` for agent-friendly output.
|
|
98
|
+
|
|
99
|
+
Application CLIs generated from `@actions.action(..., cli=...)` also support
|
|
100
|
+
remote mode:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
memuron --base-url https://api.example.app --api-key arth_sk_... memory search --query postgres
|
|
104
|
+
memuron config set --base-url https://api.example.app --api-key arth_sk_...
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Remote mode calls the action's HTTP route instead of requiring a local database.
|
|
108
|
+
Install `artha-engine[app]` (or your product package with the same extra) for
|
|
109
|
+
`httpx` support.
|
|
110
|
+
|
|
111
|
+
## Managed API keys
|
|
112
|
+
|
|
113
|
+
Products can enable per-tenant API keys with one application hook:
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from artha_engine import ArthaApplication, CompositeAuthProvider, ClerkAuthProvider
|
|
117
|
+
from artha_engine.app.managed_api_keys import ManagedApiKeyAuthProvider
|
|
118
|
+
|
|
119
|
+
application = ArthaApplication(...)
|
|
120
|
+
store = application.enable_managed_api_keys()
|
|
121
|
+
application.auth_provider = CompositeAuthProvider(
|
|
122
|
+
primary=ClerkAuthProvider(),
|
|
123
|
+
fallback=ManagedApiKeyAuthProvider(store=store),
|
|
124
|
+
)
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
This registers:
|
|
128
|
+
|
|
129
|
+
```text
|
|
130
|
+
POST /api-keys
|
|
131
|
+
GET /api-keys
|
|
132
|
+
DELETE /api-keys/{key_id}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
Keys are returned once on create (`arth_sk_...`), stored hashed, scoped, and
|
|
136
|
+
tenant-bound. A bootstrap `ARTHA_API_KEY` env var still works for ops scripts.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# Artha Engine
|
|
2
|
+
|
|
3
|
+
Artha Engine is the core Python library for building Arthaanu-based memory
|
|
4
|
+
systems. It provides:
|
|
5
|
+
|
|
6
|
+
- typed Arthaanu representations
|
|
7
|
+
- encoder, lifecycle, decoder, and projection registries
|
|
8
|
+
- an append-only semantic event ledger
|
|
9
|
+
- SQLite and in-memory stores
|
|
10
|
+
- projection replay with watermarks and status
|
|
11
|
+
- typed product actions exposed as HTTP, MCP, and CLI tools
|
|
12
|
+
- Clerk/JWT/API-key authentication adapters
|
|
13
|
+
- portable OCI application builds
|
|
14
|
+
- a small `artha` CLI for inspection and local operation
|
|
15
|
+
|
|
16
|
+
The engine is intentionally small. Product-specific memory types, profiles,
|
|
17
|
+
retrieval policy, and domain projections should usually live in userland
|
|
18
|
+
packages built on top of the engine.
|
|
19
|
+
|
|
20
|
+
## Install Locally
|
|
21
|
+
|
|
22
|
+
From this repository:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cd artha_engine
|
|
26
|
+
uv sync
|
|
27
|
+
uv run artha doctor
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
To run the FastAPI runtime:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
uv sync --extra server
|
|
34
|
+
uv run artha serve --port 8765
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Create product actions with one typed declaration:
|
|
38
|
+
|
|
39
|
+
```python
|
|
40
|
+
@actions.action(
|
|
41
|
+
name="memory.search",
|
|
42
|
+
http=("POST", "/memories/search"),
|
|
43
|
+
mcp=True,
|
|
44
|
+
cli="memory search",
|
|
45
|
+
scopes=["memory:read"],
|
|
46
|
+
)
|
|
47
|
+
def search(input: SearchInput, context: ActionContext) -> SearchOutput:
|
|
48
|
+
...
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## CLI
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
artha doctor
|
|
55
|
+
artha registry
|
|
56
|
+
artha encode text --input "Artha keeps semantic events canonical."
|
|
57
|
+
artha events --limit 5
|
|
58
|
+
artha objects --limit 5
|
|
59
|
+
artha projections
|
|
60
|
+
artha check
|
|
61
|
+
artha build
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Use `--db path/to/artha.db` to point commands at a specific SQLite ledger.
|
|
65
|
+
Most commands support `--json` for agent-friendly output.
|
|
66
|
+
|
|
67
|
+
Application CLIs generated from `@actions.action(..., cli=...)` also support
|
|
68
|
+
remote mode:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
memuron --base-url https://api.example.app --api-key arth_sk_... memory search --query postgres
|
|
72
|
+
memuron config set --base-url https://api.example.app --api-key arth_sk_...
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Remote mode calls the action's HTTP route instead of requiring a local database.
|
|
76
|
+
Install `artha-engine[app]` (or your product package with the same extra) for
|
|
77
|
+
`httpx` support.
|
|
78
|
+
|
|
79
|
+
## Managed API keys
|
|
80
|
+
|
|
81
|
+
Products can enable per-tenant API keys with one application hook:
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from artha_engine import ArthaApplication, CompositeAuthProvider, ClerkAuthProvider
|
|
85
|
+
from artha_engine.app.managed_api_keys import ManagedApiKeyAuthProvider
|
|
86
|
+
|
|
87
|
+
application = ArthaApplication(...)
|
|
88
|
+
store = application.enable_managed_api_keys()
|
|
89
|
+
application.auth_provider = CompositeAuthProvider(
|
|
90
|
+
primary=ClerkAuthProvider(),
|
|
91
|
+
fallback=ManagedApiKeyAuthProvider(store=store),
|
|
92
|
+
)
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
This registers:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
POST /api-keys
|
|
99
|
+
GET /api-keys
|
|
100
|
+
DELETE /api-keys/{key_id}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Keys are returned once on create (`arth_sk_...`), stored hashed, scoped, and
|
|
104
|
+
tenant-bound. A bootstrap `ARTHA_API_KEY` env var still works for ops scripts.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "artha-engine"
|
|
3
|
+
version = "0.1.1"
|
|
4
|
+
description = "Semantic memory engine with append-only event ledger, Arthaanu representations, and projection replay."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
authors = [
|
|
7
|
+
{ name = "Alphanimble", email = "rakshith.g@alphanimble.com" }
|
|
8
|
+
]
|
|
9
|
+
requires-python = ">=3.12"
|
|
10
|
+
dependencies = [
|
|
11
|
+
"pydantic>=2.13.4",
|
|
12
|
+
"fastembed>=0.6.0",
|
|
13
|
+
"litellm>=1.60.0",
|
|
14
|
+
"psycopg[binary]>=3.2.0",
|
|
15
|
+
]
|
|
16
|
+
keywords = ["memory", "rag", "semantic-events", "projections", "agents"]
|
|
17
|
+
classifiers = [
|
|
18
|
+
"Development Status :: 3 - Alpha",
|
|
19
|
+
"Intended Audience :: Developers",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Topic :: Software Development :: Libraries :: Application Frameworks",
|
|
22
|
+
]
|
|
23
|
+
|
|
24
|
+
[project.scripts]
|
|
25
|
+
artha = "artha_engine.cli:main"
|
|
26
|
+
|
|
27
|
+
[build-system]
|
|
28
|
+
requires = ["uv_build>=0.9.7,<0.10.0"]
|
|
29
|
+
build-backend = "uv_build"
|
|
30
|
+
|
|
31
|
+
[dependency-groups]
|
|
32
|
+
dev = [
|
|
33
|
+
"pytest>=9.0.3",
|
|
34
|
+
"pytest-asyncio>=1.0.0",
|
|
35
|
+
"fastapi>=0.115.0",
|
|
36
|
+
"httpx>=0.28.0",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
server = [
|
|
41
|
+
"fastapi>=0.115.0",
|
|
42
|
+
"uvicorn[standard]>=0.34.0",
|
|
43
|
+
]
|
|
44
|
+
app = [
|
|
45
|
+
"fastapi>=0.115.0",
|
|
46
|
+
"uvicorn[standard]>=0.34.0",
|
|
47
|
+
"httpx>=0.28.0",
|
|
48
|
+
]
|
|
49
|
+
auth = [
|
|
50
|
+
"pyjwt[crypto]>=2.10.0,<3",
|
|
51
|
+
]
|
|
52
|
+
mcp = [
|
|
53
|
+
"mcp>=1.0.0,<2",
|
|
54
|
+
]
|
|
55
|
+
workbench = [
|
|
56
|
+
"fastapi>=0.115.0",
|
|
57
|
+
"uvicorn[standard]>=0.34.0",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[tool.pytest.ini_options]
|
|
61
|
+
markers = [
|
|
62
|
+
"integration: tests that download models or hit external resources",
|
|
63
|
+
]
|
|
Binary file
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
from artha_engine.decoders import (
|
|
2
|
+
BlobRefDecoder,
|
|
3
|
+
Bm25SearchDecoder,
|
|
4
|
+
Bm25SearchParams,
|
|
5
|
+
CollectionDecodeParams,
|
|
6
|
+
CollectionDecoder,
|
|
7
|
+
CosineSimilarityDecoder,
|
|
8
|
+
Decoder,
|
|
9
|
+
EmbeddingCandidate,
|
|
10
|
+
EmbeddingSearchHit,
|
|
11
|
+
EmbeddingSearchParams,
|
|
12
|
+
EmbeddingSearchResult,
|
|
13
|
+
FusedSearchHit,
|
|
14
|
+
GraphEdgeOutput,
|
|
15
|
+
JsonDecoder,
|
|
16
|
+
LLMArthaanuSummarizeDecoder,
|
|
17
|
+
LLMTextFormatDecoder,
|
|
18
|
+
LexicalMatchDecoder,
|
|
19
|
+
LexicalSearchHit,
|
|
20
|
+
LexicalSearchParams,
|
|
21
|
+
LexicalSearchResult,
|
|
22
|
+
NoDecoderParams,
|
|
23
|
+
QueryEmbeddingDecoder,
|
|
24
|
+
QueryEmbeddingParams,
|
|
25
|
+
ReciprocalRankFusionDecoder,
|
|
26
|
+
ReciprocalRankFusionParams,
|
|
27
|
+
RelationEdgeDecoder,
|
|
28
|
+
TextCandidate,
|
|
29
|
+
TextDecoder,
|
|
30
|
+
)
|
|
31
|
+
from artha_engine.encoders import (
|
|
32
|
+
BlobRefEncoder,
|
|
33
|
+
ChunkEmbeddingEncoder,
|
|
34
|
+
CollectionEncoder,
|
|
35
|
+
DeterministicEmbeddingEncoder,
|
|
36
|
+
Encoder,
|
|
37
|
+
GraphNodeEncoder,
|
|
38
|
+
JsonEncoder,
|
|
39
|
+
LLMJsonExtractEncoder,
|
|
40
|
+
RelationEncoder,
|
|
41
|
+
TextEncoder,
|
|
42
|
+
)
|
|
43
|
+
from artha_engine.lifecycle import (
|
|
44
|
+
CORE_LIFECYCLES_BY_NAME,
|
|
45
|
+
CollectionDedupeLifecycle,
|
|
46
|
+
JsonMergeLifecycle,
|
|
47
|
+
Lifecycle,
|
|
48
|
+
MultiLifecycle,
|
|
49
|
+
TextNormalizationLifecycle,
|
|
50
|
+
)
|
|
51
|
+
from artha_engine.representations import (
|
|
52
|
+
ARTHAANU_TYPES_BY_VALUE_TYPE,
|
|
53
|
+
Arthaanu,
|
|
54
|
+
BlobRefArthaanu,
|
|
55
|
+
CollectionArthaanu,
|
|
56
|
+
EmbeddingArthaanu,
|
|
57
|
+
GraphNodeArthaanu,
|
|
58
|
+
JsonArthaanu,
|
|
59
|
+
RelationArthaanu,
|
|
60
|
+
RelationValue,
|
|
61
|
+
SUPPORTED_VALUE_TYPES,
|
|
62
|
+
TextArthaanu,
|
|
63
|
+
)
|
|
64
|
+
from artha_engine.runtime import (
|
|
65
|
+
ArthaEngine,
|
|
66
|
+
AuthContext,
|
|
67
|
+
ComponentRegistry,
|
|
68
|
+
DEFAULT_DATABASE_URL,
|
|
69
|
+
DEFAULT_DB_PATH,
|
|
70
|
+
InMemoryArthaStore,
|
|
71
|
+
PostgresArthaStore,
|
|
72
|
+
SqliteArthaStore,
|
|
73
|
+
arthaanu_from_dict,
|
|
74
|
+
arthaanu_to_dict,
|
|
75
|
+
build_core_registry,
|
|
76
|
+
create_store,
|
|
77
|
+
default_store,
|
|
78
|
+
list_decoders,
|
|
79
|
+
list_encoders,
|
|
80
|
+
list_lifecycles,
|
|
81
|
+
list_projections,
|
|
82
|
+
normalize_auth_context,
|
|
83
|
+
normalize_profile_capabilities,
|
|
84
|
+
Projection,
|
|
85
|
+
ProfileCapability,
|
|
86
|
+
resolve_database_target,
|
|
87
|
+
)
|
|
88
|
+
from artha_engine.store import ArthaStore
|
|
89
|
+
from artha_engine.llms import (
|
|
90
|
+
DEFAULT_LLM,
|
|
91
|
+
DEFAULT_LLM_MODEL,
|
|
92
|
+
DeterministicTextGenerator,
|
|
93
|
+
LiteLLMTextGenerator,
|
|
94
|
+
TemplateTextGenerator,
|
|
95
|
+
TextGenerator,
|
|
96
|
+
default_llm,
|
|
97
|
+
)
|
|
98
|
+
from artha_engine.retrieval import Bm25Index, reciprocal_rank_fusion
|
|
99
|
+
from artha_engine.embeddings import (
|
|
100
|
+
DEFAULT_EMBEDDER,
|
|
101
|
+
DEFAULT_MODEL,
|
|
102
|
+
DeterministicTextEmbedder,
|
|
103
|
+
FastEmbedTextEmbedder,
|
|
104
|
+
NOMIC_DOCUMENT_PREFIX,
|
|
105
|
+
NOMIC_QUERY_PREFIX,
|
|
106
|
+
TextEmbedder,
|
|
107
|
+
default_embedder,
|
|
108
|
+
)
|
|
109
|
+
from artha_engine.app import (
|
|
110
|
+
ActionContext,
|
|
111
|
+
ActionDefinition,
|
|
112
|
+
ActionManifest,
|
|
113
|
+
ActionRegistry,
|
|
114
|
+
AnonymousAuthProvider,
|
|
115
|
+
ApiKeyAuthProvider,
|
|
116
|
+
ArthaApplication,
|
|
117
|
+
AuthProvider,
|
|
118
|
+
ClerkAuthProvider,
|
|
119
|
+
HttpExposure,
|
|
120
|
+
JwtAuthProvider,
|
|
121
|
+
McpHttpCompatibilityMiddleware,
|
|
122
|
+
ScopeAuthorizationPolicy,
|
|
123
|
+
action,
|
|
124
|
+
auth_provider_from_env,
|
|
125
|
+
streamable_http_app,
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
__all__ = [
|
|
129
|
+
"ARTHAANU_TYPES_BY_VALUE_TYPE",
|
|
130
|
+
"Arthaanu",
|
|
131
|
+
"BlobRefArthaanu",
|
|
132
|
+
"CollectionArthaanu",
|
|
133
|
+
"TextArthaanu",
|
|
134
|
+
"EmbeddingArthaanu",
|
|
135
|
+
"JsonArthaanu",
|
|
136
|
+
"RelationArthaanu",
|
|
137
|
+
"RelationValue",
|
|
138
|
+
"SUPPORTED_VALUE_TYPES",
|
|
139
|
+
"GraphNodeArthaanu",
|
|
140
|
+
"BlobRefEncoder",
|
|
141
|
+
"ChunkEmbeddingEncoder",
|
|
142
|
+
"CollectionEncoder",
|
|
143
|
+
"DeterministicEmbeddingEncoder",
|
|
144
|
+
"Encoder",
|
|
145
|
+
"GraphNodeEncoder",
|
|
146
|
+
"JsonEncoder",
|
|
147
|
+
"LLMJsonExtractEncoder",
|
|
148
|
+
"RelationEncoder",
|
|
149
|
+
"TextEncoder",
|
|
150
|
+
"CORE_LIFECYCLES_BY_NAME",
|
|
151
|
+
"CollectionDedupeLifecycle",
|
|
152
|
+
"JsonMergeLifecycle",
|
|
153
|
+
"Lifecycle",
|
|
154
|
+
"MultiLifecycle",
|
|
155
|
+
"TextNormalizationLifecycle",
|
|
156
|
+
"Bm25Index",
|
|
157
|
+
"BlobRefDecoder",
|
|
158
|
+
"Bm25SearchDecoder",
|
|
159
|
+
"Bm25SearchParams",
|
|
160
|
+
"CollectionDecodeParams",
|
|
161
|
+
"CollectionDecoder",
|
|
162
|
+
"CosineSimilarityDecoder",
|
|
163
|
+
"Decoder",
|
|
164
|
+
"DEFAULT_LLM",
|
|
165
|
+
"DEFAULT_LLM_MODEL",
|
|
166
|
+
"DeterministicTextGenerator",
|
|
167
|
+
"EmbeddingCandidate",
|
|
168
|
+
"EmbeddingSearchHit",
|
|
169
|
+
"EmbeddingSearchParams",
|
|
170
|
+
"EmbeddingSearchResult",
|
|
171
|
+
"FusedSearchHit",
|
|
172
|
+
"GraphEdgeOutput",
|
|
173
|
+
"JsonDecoder",
|
|
174
|
+
"LLMArthaanuSummarizeDecoder",
|
|
175
|
+
"LLMJsonExtractEncoder",
|
|
176
|
+
"LLMTextFormatDecoder",
|
|
177
|
+
"LexicalMatchDecoder",
|
|
178
|
+
"LexicalSearchHit",
|
|
179
|
+
"LexicalSearchParams",
|
|
180
|
+
"LexicalSearchResult",
|
|
181
|
+
"LiteLLMTextGenerator",
|
|
182
|
+
"NoDecoderParams",
|
|
183
|
+
"QueryEmbeddingDecoder",
|
|
184
|
+
"QueryEmbeddingParams",
|
|
185
|
+
"ReciprocalRankFusionDecoder",
|
|
186
|
+
"ReciprocalRankFusionParams",
|
|
187
|
+
"RelationEdgeDecoder",
|
|
188
|
+
"TemplateTextGenerator",
|
|
189
|
+
"TextCandidate",
|
|
190
|
+
"TextDecoder",
|
|
191
|
+
"TextGenerator",
|
|
192
|
+
"default_llm",
|
|
193
|
+
"reciprocal_rank_fusion",
|
|
194
|
+
"ArthaEngine",
|
|
195
|
+
"ArthaStore",
|
|
196
|
+
"AuthContext",
|
|
197
|
+
"ComponentRegistry",
|
|
198
|
+
"DEFAULT_DATABASE_URL",
|
|
199
|
+
"DEFAULT_DB_PATH",
|
|
200
|
+
"InMemoryArthaStore",
|
|
201
|
+
"PostgresArthaStore",
|
|
202
|
+
"Projection",
|
|
203
|
+
"ProfileCapability",
|
|
204
|
+
"SqliteArthaStore",
|
|
205
|
+
"arthaanu_from_dict",
|
|
206
|
+
"arthaanu_to_dict",
|
|
207
|
+
"build_core_registry",
|
|
208
|
+
"create_store",
|
|
209
|
+
"default_store",
|
|
210
|
+
"resolve_database_target",
|
|
211
|
+
"list_decoders",
|
|
212
|
+
"list_encoders",
|
|
213
|
+
"list_lifecycles",
|
|
214
|
+
"list_projections",
|
|
215
|
+
"normalize_auth_context",
|
|
216
|
+
"normalize_profile_capabilities",
|
|
217
|
+
"DEFAULT_EMBEDDER",
|
|
218
|
+
"DEFAULT_MODEL",
|
|
219
|
+
"DeterministicTextEmbedder",
|
|
220
|
+
"FastEmbedTextEmbedder",
|
|
221
|
+
"NOMIC_DOCUMENT_PREFIX",
|
|
222
|
+
"NOMIC_QUERY_PREFIX",
|
|
223
|
+
"TextEmbedder",
|
|
224
|
+
"default_embedder",
|
|
225
|
+
"ActionContext",
|
|
226
|
+
"ActionDefinition",
|
|
227
|
+
"ActionManifest",
|
|
228
|
+
"ActionRegistry",
|
|
229
|
+
"AnonymousAuthProvider",
|
|
230
|
+
"ApiKeyAuthProvider",
|
|
231
|
+
"ArthaApplication",
|
|
232
|
+
"AuthProvider",
|
|
233
|
+
"ClerkAuthProvider",
|
|
234
|
+
"HttpExposure",
|
|
235
|
+
"JwtAuthProvider",
|
|
236
|
+
"McpHttpCompatibilityMiddleware",
|
|
237
|
+
"ScopeAuthorizationPolicy",
|
|
238
|
+
"action",
|
|
239
|
+
"auth_provider_from_env",
|
|
240
|
+
"streamable_http_app",
|
|
241
|
+
]
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
from artha_engine.app.actions import (
|
|
2
|
+
ActionDefinition,
|
|
3
|
+
ActionKind,
|
|
4
|
+
ActionManifest,
|
|
5
|
+
ActionRegistry,
|
|
6
|
+
CliExposure,
|
|
7
|
+
HttpExposure,
|
|
8
|
+
McpExposure,
|
|
9
|
+
action,
|
|
10
|
+
)
|
|
11
|
+
from artha_engine.app.application import ArthaApplication
|
|
12
|
+
from artha_engine.app.auth import (
|
|
13
|
+
AnonymousAuthProvider,
|
|
14
|
+
ApiKeyAuthProvider,
|
|
15
|
+
AuthenticationError,
|
|
16
|
+
AuthConfigurationError,
|
|
17
|
+
AuthProvider,
|
|
18
|
+
ClerkAuthProvider,
|
|
19
|
+
JwtAuthProvider,
|
|
20
|
+
auth_provider_from_env,
|
|
21
|
+
)
|
|
22
|
+
from artha_engine.app.managed_api_keys import (
|
|
23
|
+
CompositeAuthProvider,
|
|
24
|
+
ManagedApiKeyAuthProvider,
|
|
25
|
+
enable_managed_api_keys,
|
|
26
|
+
register_api_key_actions,
|
|
27
|
+
)
|
|
28
|
+
from artha_engine.app.authorization import (
|
|
29
|
+
AuthorizationDenied,
|
|
30
|
+
AuthorizationPolicy,
|
|
31
|
+
ScopeAuthorizationPolicy,
|
|
32
|
+
)
|
|
33
|
+
from artha_engine.app.context import ActionContext
|
|
34
|
+
from artha_engine.app.mcp import (
|
|
35
|
+
McpHttpCompatibilityMiddleware,
|
|
36
|
+
create_mcp_server,
|
|
37
|
+
run_mcp,
|
|
38
|
+
streamable_http_app,
|
|
39
|
+
)
|
|
40
|
+
|
|
41
|
+
__all__ = [
|
|
42
|
+
"ActionContext",
|
|
43
|
+
"ActionDefinition",
|
|
44
|
+
"ActionKind",
|
|
45
|
+
"ActionManifest",
|
|
46
|
+
"ActionRegistry",
|
|
47
|
+
"AnonymousAuthProvider",
|
|
48
|
+
"ApiKeyAuthProvider",
|
|
49
|
+
"ArthaApplication",
|
|
50
|
+
"AuthenticationError",
|
|
51
|
+
"AuthConfigurationError",
|
|
52
|
+
"AuthProvider",
|
|
53
|
+
"AuthorizationDenied",
|
|
54
|
+
"AuthorizationPolicy",
|
|
55
|
+
"CliExposure",
|
|
56
|
+
"CompositeAuthProvider",
|
|
57
|
+
"ClerkAuthProvider",
|
|
58
|
+
"HttpExposure",
|
|
59
|
+
"JwtAuthProvider",
|
|
60
|
+
"ManagedApiKeyAuthProvider",
|
|
61
|
+
"McpExposure",
|
|
62
|
+
"McpHttpCompatibilityMiddleware",
|
|
63
|
+
"ScopeAuthorizationPolicy",
|
|
64
|
+
"action",
|
|
65
|
+
"auth_provider_from_env",
|
|
66
|
+
"create_mcp_server",
|
|
67
|
+
"enable_managed_api_keys",
|
|
68
|
+
"register_api_key_actions",
|
|
69
|
+
"run_mcp",
|
|
70
|
+
"streamable_http_app",
|
|
71
|
+
]
|