relio 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.
- relio-0.1.0/.gitignore +171 -0
- relio-0.1.0/CONTRIBUTING.md +80 -0
- relio-0.1.0/LICENSE +21 -0
- relio-0.1.0/PKG-INFO +302 -0
- relio-0.1.0/README.md +239 -0
- relio-0.1.0/docs/superpowers/plans/2026-06-30-relio-backend-layer.md +936 -0
- relio-0.1.0/docs/superpowers/plans/2026-06-30-relio-devops-layer.md +647 -0
- relio-0.1.0/docs/superpowers/plans/2026-06-30-relio-frontend-layer.md +933 -0
- relio-0.1.0/docs/superpowers/plans/2026-06-30-relio-memory-engine.md +1441 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-agents-design.md +41 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-ai-seam-design.md +56 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-architecture-v2-app-first.md +237 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-auth-design.md +60 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-backend-design.md +108 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-dev-harness-design.md +69 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-devops-design.md +122 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-efficiency-design.md +42 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-exposure-map-design.md +45 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-extraction-design.md +42 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-framework-architecture.md +342 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-frontend-design.md +116 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-graph-design.md +57 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-history-design.md +74 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-llm-optional-design.md +41 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-memory-design.md +263 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-mobile-desktop-design.md +53 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-pg-pool-design.md +37 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-postgres-backend-design.md +88 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-query-design.md +43 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-sdkgen-design.md +47 -0
- relio-0.1.0/docs/superpowers/specs/2026-06-30-relio-web-template-design.md +47 -0
- relio-0.1.0/frontend/index.html +18 -0
- relio-0.1.0/frontend/package-lock.json +3210 -0
- relio-0.1.0/frontend/package.json +28 -0
- relio-0.1.0/frontend/src/App.tsx +18 -0
- relio-0.1.0/frontend/src/api/client.ts +65 -0
- relio-0.1.0/frontend/src/api/types.ts +33 -0
- relio-0.1.0/frontend/src/components/ChatView.tsx +70 -0
- relio-0.1.0/frontend/src/components/MemoryBrowser.tsx +85 -0
- relio-0.1.0/frontend/src/main.tsx +10 -0
- relio-0.1.0/frontend/src/styles.css +71 -0
- relio-0.1.0/frontend/tests/ChatView.test.tsx +33 -0
- relio-0.1.0/frontend/tests/MemoryBrowser.test.tsx +64 -0
- relio-0.1.0/frontend/tests/client.test.ts +79 -0
- relio-0.1.0/frontend/tests/setup.ts +1 -0
- relio-0.1.0/frontend/tests/smoke.test.tsx +18 -0
- relio-0.1.0/frontend/tsconfig.json +14 -0
- relio-0.1.0/frontend/vite.config.ts +13 -0
- relio-0.1.0/pyproject.toml +47 -0
- relio-0.1.0/relio/__init__.py +24 -0
- relio-0.1.0/relio/agents.py +72 -0
- relio-0.1.0/relio/ai.py +190 -0
- relio-0.1.0/relio/backends/__init__.py +0 -0
- relio-0.1.0/relio/backends/base.py +56 -0
- relio-0.1.0/relio/backends/postgres.py +176 -0
- relio-0.1.0/relio/backends/sqlite.py +184 -0
- relio-0.1.0/relio/cli/__init__.py +0 -0
- relio-0.1.0/relio/cli/check.py +96 -0
- relio-0.1.0/relio/cli/dockerfile.py +32 -0
- relio-0.1.0/relio/cli/main.py +185 -0
- relio-0.1.0/relio/cli/scaffold.py +330 -0
- relio-0.1.0/relio/embedding/__init__.py +0 -0
- relio-0.1.0/relio/embedding/base.py +47 -0
- relio-0.1.0/relio/embedding/cache.py +37 -0
- relio-0.1.0/relio/embedding/local.py +31 -0
- relio-0.1.0/relio/exposure.py +80 -0
- relio-0.1.0/relio/graph.py +63 -0
- relio-0.1.0/relio/interchange.py +55 -0
- relio-0.1.0/relio/mcp_server.py +31 -0
- relio-0.1.0/relio/memory.py +222 -0
- relio-0.1.0/relio/recall.py +47 -0
- relio-0.1.0/relio/record.py +64 -0
- relio-0.1.0/relio/render.py +34 -0
- relio-0.1.0/relio/sdkgen.py +380 -0
- relio-0.1.0/relio/server/__init__.py +7 -0
- relio-0.1.0/relio/server/agent.py +45 -0
- relio-0.1.0/relio/server/app.py +43 -0
- relio-0.1.0/relio/server/auth.py +45 -0
- relio-0.1.0/relio/server/config.py +14 -0
- relio-0.1.0/relio/server/llm/__init__.py +0 -0
- relio-0.1.0/relio/server/llm/base.py +32 -0
- relio-0.1.0/relio/server/llm/claude.py +57 -0
- relio-0.1.0/relio/server/llm/fake.py +32 -0
- relio-0.1.0/relio/server/routes/__init__.py +0 -0
- relio-0.1.0/relio/server/routes/chat.py +44 -0
- relio-0.1.0/relio/server/routes/graph.py +26 -0
- relio-0.1.0/relio/server/routes/history.py +39 -0
- relio-0.1.0/relio/server/routes/memory.py +64 -0
- relio-0.1.0/relio/server/schemas.py +30 -0
- relio-0.1.0/relio/server/scope.py +15 -0
- relio-0.1.0/relio/server/static.py +29 -0
- relio-0.1.0/relio/templates/desktop/README.md +24 -0
- relio-0.1.0/relio/templates/desktop/package.json +24 -0
- relio-0.1.0/relio/templates/desktop/src-tauri/Cargo.toml +12 -0
- relio-0.1.0/relio/templates/desktop/src-tauri/build.rs +3 -0
- relio-0.1.0/relio/templates/desktop/src-tauri/src/main.rs +8 -0
- relio-0.1.0/relio/templates/desktop/src-tauri/tauri.conf.json +28 -0
- relio-0.1.0/relio/templates/mobile/App.tsx +74 -0
- relio-0.1.0/relio/templates/mobile/README.md +22 -0
- relio-0.1.0/relio/templates/mobile/app.json +10 -0
- relio-0.1.0/relio/templates/mobile/babel.config.js +6 -0
- relio-0.1.0/relio/templates/mobile/package.json +22 -0
- relio-0.1.0/relio/templates/mobile/tsconfig.json +6 -0
- relio-0.1.0/relio/templates/web/index.html +12 -0
- relio-0.1.0/relio/templates/web/package.json +24 -0
- relio-0.1.0/relio/templates/web/src/App.tsx +20 -0
- relio-0.1.0/relio/templates/web/src/components/ChatView.tsx +69 -0
- relio-0.1.0/relio/templates/web/src/components/MemoryBrowser.tsx +84 -0
- relio-0.1.0/relio/templates/web/src/main.tsx +10 -0
- relio-0.1.0/relio/templates/web/src/styles.css +147 -0
- relio-0.1.0/relio/templates/web/tsconfig.json +18 -0
- relio-0.1.0/relio/templates/web/vite.config.ts +19 -0
- relio-0.1.0/tests/__init__.py +0 -0
- relio-0.1.0/tests/server/__init__.py +0 -0
- relio-0.1.0/tests/server/conftest.py +16 -0
- relio-0.1.0/tests/server/test_auth.py +91 -0
- relio-0.1.0/tests/server/test_chat_routes.py +72 -0
- relio-0.1.0/tests/server/test_claude_provider.py +44 -0
- relio-0.1.0/tests/server/test_graph_routes.py +23 -0
- relio-0.1.0/tests/server/test_health.py +20 -0
- relio-0.1.0/tests/server/test_history_routes.py +69 -0
- relio-0.1.0/tests/server/test_llm_optional.py +36 -0
- relio-0.1.0/tests/server/test_memory_routes.py +58 -0
- relio-0.1.0/tests/server/test_query_routes.py +19 -0
- relio-0.1.0/tests/test_agents.py +81 -0
- relio-0.1.0/tests/test_ai_seam.py +77 -0
- relio-0.1.0/tests/test_check.py +62 -0
- relio-0.1.0/tests/test_cli.py +141 -0
- relio-0.1.0/tests/test_dockerfile.py +11 -0
- relio-0.1.0/tests/test_efficiency.py +51 -0
- relio-0.1.0/tests/test_embedding.py +74 -0
- relio-0.1.0/tests/test_exposure.py +74 -0
- relio-0.1.0/tests/test_extraction.py +52 -0
- relio-0.1.0/tests/test_graph.py +70 -0
- relio-0.1.0/tests/test_history.py +68 -0
- relio-0.1.0/tests/test_interchange.py +44 -0
- relio-0.1.0/tests/test_mcp_server.py +19 -0
- relio-0.1.0/tests/test_memory.py +86 -0
- relio-0.1.0/tests/test_postgres_backend.py +129 -0
- relio-0.1.0/tests/test_query.py +97 -0
- relio-0.1.0/tests/test_recall.py +44 -0
- relio-0.1.0/tests/test_record.py +29 -0
- relio-0.1.0/tests/test_render.py +27 -0
- relio-0.1.0/tests/test_scaffold.py +81 -0
- relio-0.1.0/tests/test_sdkgen.py +70 -0
- relio-0.1.0/tests/test_sqlite_backend.py +64 -0
- relio-0.1.0/tests/test_static.py +51 -0
relio-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
bin/
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# Pyinstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so content is dynamic.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nosenv/
|
|
43
|
+
.pytest_cache/
|
|
44
|
+
.mypy_cache/
|
|
45
|
+
.cache/
|
|
46
|
+
.ruff_cache/
|
|
47
|
+
.coverage
|
|
48
|
+
.coverage.*
|
|
49
|
+
.cache
|
|
50
|
+
nosetests.xml
|
|
51
|
+
coverage.xml
|
|
52
|
+
*.cover
|
|
53
|
+
*.py,cover
|
|
54
|
+
.hypothesis/
|
|
55
|
+
|
|
56
|
+
# Translations
|
|
57
|
+
*.mo
|
|
58
|
+
*.pot
|
|
59
|
+
|
|
60
|
+
# Django stuff:
|
|
61
|
+
*.log
|
|
62
|
+
local_settings.py
|
|
63
|
+
db.sqlite3
|
|
64
|
+
db.sqlite3-journal
|
|
65
|
+
|
|
66
|
+
# Sphinx documentation
|
|
67
|
+
docs/_build/
|
|
68
|
+
|
|
69
|
+
# PyBuilder
|
|
70
|
+
.pybuilder/
|
|
71
|
+
target/
|
|
72
|
+
|
|
73
|
+
# Jupyter Notebook
|
|
74
|
+
.ipynb_checkpoints
|
|
75
|
+
|
|
76
|
+
# IPython
|
|
77
|
+
profile_default/
|
|
78
|
+
ipython_config.py
|
|
79
|
+
|
|
80
|
+
# pyenv
|
|
81
|
+
# For a library or app, you might want to share your .python-version.
|
|
82
|
+
# Reference: https://github.com/pyenv/pyenv/blob/master/COMMANDS.md#pyenv-version
|
|
83
|
+
#.python-version
|
|
84
|
+
|
|
85
|
+
# pipenv
|
|
86
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
87
|
+
# However, in case of collaboration, if lock is used, it may cause conflicts.
|
|
88
|
+
#Pipfile.lock
|
|
89
|
+
|
|
90
|
+
# poetry
|
|
91
|
+
# Using Poetry requires Pipfile.lock to be in version control, but it might not be if you're not using Poetry.
|
|
92
|
+
#poetry.lock
|
|
93
|
+
|
|
94
|
+
# pdm
|
|
95
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
96
|
+
#.pdm-python
|
|
97
|
+
#pdm.lock
|
|
98
|
+
|
|
99
|
+
# PEP 582; used by e.g. pdm
|
|
100
|
+
__pypackages__/
|
|
101
|
+
|
|
102
|
+
# Celery stuff
|
|
103
|
+
celerybeat-schedule
|
|
104
|
+
celerybeat.pid
|
|
105
|
+
|
|
106
|
+
# SageMath parsed files
|
|
107
|
+
*.sage.py
|
|
108
|
+
|
|
109
|
+
# Environments
|
|
110
|
+
.env
|
|
111
|
+
.venv
|
|
112
|
+
env/
|
|
113
|
+
venv/
|
|
114
|
+
ENV/
|
|
115
|
+
env.bak/
|
|
116
|
+
venv.bak/
|
|
117
|
+
|
|
118
|
+
# Spyder project settings
|
|
119
|
+
.spyderproject
|
|
120
|
+
.spyproject
|
|
121
|
+
|
|
122
|
+
# Rope project settings
|
|
123
|
+
.ropeproject
|
|
124
|
+
|
|
125
|
+
# mkdocs documentation
|
|
126
|
+
/site
|
|
127
|
+
|
|
128
|
+
# mypy
|
|
129
|
+
.mypy_cache/
|
|
130
|
+
.dmypy.json
|
|
131
|
+
dmypy.json
|
|
132
|
+
|
|
133
|
+
# Pyre type checker
|
|
134
|
+
.pyre/
|
|
135
|
+
|
|
136
|
+
# pytype static type analyzer
|
|
137
|
+
.pytype/
|
|
138
|
+
|
|
139
|
+
# Cython debug symbols
|
|
140
|
+
cython_debug/
|
|
141
|
+
|
|
142
|
+
# OS metadata
|
|
143
|
+
.DS_Store
|
|
144
|
+
Thumbs.db
|
|
145
|
+
|
|
146
|
+
# IDEs
|
|
147
|
+
.vscode/
|
|
148
|
+
.idea/
|
|
149
|
+
.claude/
|
|
150
|
+
*.suo
|
|
151
|
+
*.ntvs*
|
|
152
|
+
*.njsproj
|
|
153
|
+
*.sln
|
|
154
|
+
*.swp
|
|
155
|
+
|
|
156
|
+
# Relio specific database files
|
|
157
|
+
*.db
|
|
158
|
+
*.sqlite
|
|
159
|
+
*.sqlite3
|
|
160
|
+
relio.db
|
|
161
|
+
query_log.json
|
|
162
|
+
|
|
163
|
+
# Node/React frontend
|
|
164
|
+
node_modules/
|
|
165
|
+
frontend/node_modules/
|
|
166
|
+
frontend/dist/
|
|
167
|
+
frontend/.env
|
|
168
|
+
frontend/.env.local
|
|
169
|
+
frontend/.env.development.local
|
|
170
|
+
frontend/.env.test.local
|
|
171
|
+
frontend/.env.production.local
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Contributing to Relio
|
|
2
|
+
|
|
3
|
+
Thanks for working on Relio. This guide gets you from clone to green tests and
|
|
4
|
+
explains the conventions the codebase follows.
|
|
5
|
+
|
|
6
|
+
## Dev setup
|
|
7
|
+
|
|
8
|
+
Requires Python 3.11+.
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
git clone <repo> relio && cd relio
|
|
12
|
+
python -m venv .venv && . .venv/bin/activate # Windows: .venv\Scripts\activate
|
|
13
|
+
pip install -e ".[dev]"
|
|
14
|
+
pytest # should be all green
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
`pyproject.toml` sets `pythonpath = ["."]`, so `pytest` finds the `relio`
|
|
18
|
+
package without any extra setup.
|
|
19
|
+
|
|
20
|
+
### Optional / gated tests
|
|
21
|
+
- **Postgres** integration tests are skipped unless a database is provided:
|
|
22
|
+
```bash
|
|
23
|
+
RELIO_TEST_DATABASE_URL=postgresql://user:pass@localhost/relio_test pytest -m integration
|
|
24
|
+
```
|
|
25
|
+
(Needs the `vector` extension available.)
|
|
26
|
+
- **Local embedding** model tests download a model; they're marked `integration`.
|
|
27
|
+
|
|
28
|
+
## How the project is built
|
|
29
|
+
|
|
30
|
+
Relio is developed **spec-first, test-first**:
|
|
31
|
+
|
|
32
|
+
1. **Design spec** — non-trivial work starts with a short spec under
|
|
33
|
+
`docs/superpowers/specs/YYYY-MM-DD-<topic>-design.md` (goal, design, tests,
|
|
34
|
+
what's out of scope).
|
|
35
|
+
2. **Tests first** — write the failing tests, then the implementation.
|
|
36
|
+
3. **Keep the suite green** — every change leaves `pytest` passing.
|
|
37
|
+
|
|
38
|
+
The architecture is described in
|
|
39
|
+
`docs/superpowers/specs/2026-06-30-relio-architecture-v2-app-first.md` — read it
|
|
40
|
+
before adding a component. The short version: the app is the developer's; the AI
|
|
41
|
+
engine is a **called-in component** (`RelioAI`); the DB is reached only through
|
|
42
|
+
the **exposure map**; agents are **bounded contexts**.
|
|
43
|
+
|
|
44
|
+
## Conventions
|
|
45
|
+
|
|
46
|
+
- **One concern per module.** When a file grows large, split it.
|
|
47
|
+
- **Match the surrounding code** — naming, comment density, idioms.
|
|
48
|
+
- **No new network hops.** The backend↔engine call is in-process by design; keep
|
|
49
|
+
it that way unless a component genuinely must scale out behind a seam
|
|
50
|
+
(`StorageBackend`, `AuthHook`, MCP).
|
|
51
|
+
- **Backends implement the full `StorageBackend` contract** (`add/get/delete/
|
|
52
|
+
search/all/query/transaction/close`); add the matching SQLite **and** Postgres
|
|
53
|
+
paths, with Postgres tests gated `integration`.
|
|
54
|
+
- **Identity comes from the auth hook**, never from request bodies.
|
|
55
|
+
- **Tests + docs for everything.** The framework ships a `relio check` gate that
|
|
56
|
+
enforces this on scaffolded apps; hold the framework's own code to the same bar
|
|
57
|
+
(a test for every module, a design spec for every feature).
|
|
58
|
+
|
|
59
|
+
## Layout
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
relio/ai.py # RelioAI seam
|
|
63
|
+
relio/exposure.py # exposure map (tool registry + field allowlist)
|
|
64
|
+
relio/agents.py # bounded agents
|
|
65
|
+
relio/memory.py # the engine (add/recall/history/query/graph/transaction)
|
|
66
|
+
relio/backends/ # sqlite.py, postgres.py (StorageBackend)
|
|
67
|
+
relio/embedding/ # base/local/cache (+ batch)
|
|
68
|
+
relio/server/ # app, routes (memory/chat/graph/history), auth, llm, agent
|
|
69
|
+
relio/cli/ # main, scaffold, check, dockerfile
|
|
70
|
+
relio/sdkgen.py # OpenAPI -> TS + Python SDK
|
|
71
|
+
relio/templates/ # web / mobile / desktop scaffolds
|
|
72
|
+
tests/ # mirrors the package; server tests under tests/server/
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Pull requests
|
|
76
|
+
|
|
77
|
+
- Reference or include the design spec for the change.
|
|
78
|
+
- Keep PRs focused; one feature/concern per PR.
|
|
79
|
+
- Run `pytest` (and `pytest -m integration` if you touched Postgres paths).
|
|
80
|
+
- Update the relevant doc/spec in the same PR.
|
relio-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Relio contributors
|
|
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.
|
relio-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: relio
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Relio — app-first AI framework with a built-in, governed memory engine
|
|
5
|
+
Author-email: Sujith Krishnan <sujith.krishnan@techjays.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Relio contributors
|
|
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
|
+
License-File: LICENSE
|
|
28
|
+
Keywords: agents,ai,fastapi,framework,llm,mcp,memory,pgvector,rag,react,vector
|
|
29
|
+
Classifier: Development Status :: 3 - Alpha
|
|
30
|
+
Classifier: Intended Audience :: Developers
|
|
31
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
|
33
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
35
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
36
|
+
Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
37
|
+
Requires-Python: >=3.11
|
|
38
|
+
Requires-Dist: pydantic>=2.6
|
|
39
|
+
Requires-Dist: sqlite-vec>=0.1.6
|
|
40
|
+
Provides-Extra: dev
|
|
41
|
+
Requires-Dist: anthropic>=0.40; extra == 'dev'
|
|
42
|
+
Requires-Dist: fastapi>=0.110; extra == 'dev'
|
|
43
|
+
Requires-Dist: fastembed>=0.3; extra == 'dev'
|
|
44
|
+
Requires-Dist: httpx>=0.27; extra == 'dev'
|
|
45
|
+
Requires-Dist: mcp>=1.2; extra == 'dev'
|
|
46
|
+
Requires-Dist: pydantic-settings>=2.2; extra == 'dev'
|
|
47
|
+
Requires-Dist: pytest-cov>=5; extra == 'dev'
|
|
48
|
+
Requires-Dist: pytest>=8; extra == 'dev'
|
|
49
|
+
Requires-Dist: uvicorn>=0.30; extra == 'dev'
|
|
50
|
+
Provides-Extra: local
|
|
51
|
+
Requires-Dist: fastembed>=0.3; extra == 'local'
|
|
52
|
+
Provides-Extra: mcp
|
|
53
|
+
Requires-Dist: mcp>=1.2; extra == 'mcp'
|
|
54
|
+
Provides-Extra: postgres
|
|
55
|
+
Requires-Dist: psycopg-pool>=3.2; extra == 'postgres'
|
|
56
|
+
Requires-Dist: psycopg[binary]>=3.1; extra == 'postgres'
|
|
57
|
+
Provides-Extra: server
|
|
58
|
+
Requires-Dist: anthropic>=0.40; extra == 'server'
|
|
59
|
+
Requires-Dist: fastapi>=0.110; extra == 'server'
|
|
60
|
+
Requires-Dist: pydantic-settings>=2.2; extra == 'server'
|
|
61
|
+
Requires-Dist: uvicorn>=0.30; extra == 'server'
|
|
62
|
+
Description-Content-Type: text/markdown
|
|
63
|
+
|
|
64
|
+
# Relio
|
|
65
|
+
|
|
66
|
+
**An app-first AI framework.** Build a normal FastAPI + React app with your own
|
|
67
|
+
data, and *call AI in* where you need it — memory, retrieval, agents, document
|
|
68
|
+
extraction, and MCP — as one in-process component, not a pile of services.
|
|
69
|
+
|
|
70
|
+
> Relio is **memory-native**: vectors + graph + structured query live in one
|
|
71
|
+
> SQLite file (or Postgres), and the AI reaches your app's data only through a
|
|
72
|
+
> governed, field-limited **exposure map**.
|
|
73
|
+
|
|
74
|
+
- **One seamless system** — backend calls the AI in-process (no network hop), one
|
|
75
|
+
port, one deploy.
|
|
76
|
+
- **AI is a component, not the product** — the `RelioAI` seam is LLM-optional;
|
|
77
|
+
use just `recall`, or the whole stack (chat, agents, extraction, MCP).
|
|
78
|
+
- **Governed by default** — the AI sees only what you declare; agents are bounded
|
|
79
|
+
contexts with their own memory + tools.
|
|
80
|
+
- **Batteries for building** — scaffolds (web/mobile/desktop), generated SDKs, and
|
|
81
|
+
a dev harness that won't let code land without a test and a doc.
|
|
82
|
+
|
|
83
|
+
> Status: early / pre-release (`0.1.0`). The engine, server, SDKs, agents,
|
|
84
|
+
> extraction, and CLI are tested. Postgres paths and the vision/extraction model
|
|
85
|
+
> call are integration-gated (need a live DB / API). See [Status](#status).
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Install
|
|
90
|
+
|
|
91
|
+
Requires **Python 3.11+** (and Node 18+ only if you scaffold a web/mobile/desktop
|
|
92
|
+
client).
|
|
93
|
+
|
|
94
|
+
> **Not on PyPI yet** (pre-release `0.1.0`) — install from source.
|
|
95
|
+
|
|
96
|
+
Clone and install editable:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
git clone <repo> relio
|
|
100
|
+
cd relio
|
|
101
|
+
pip install -e ".[server]" # or ".[dev]" for the full toolchain + tests
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
…or install straight from a local checkout without `cd`-ing into it (note the
|
|
105
|
+
quotes — the brackets are part of the requirement):
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pip install -e "C:/path/to/relio[server]"
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Once it's published, this will be:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
pip install "relio[server]"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
Optional extras (combine, e.g. `.[server,postgres]`):
|
|
118
|
+
|
|
119
|
+
| Extra | Adds |
|
|
120
|
+
|-------|------|
|
|
121
|
+
| `local` | local ONNX embeddings (`fastembed`) — zero-API-cost vectors |
|
|
122
|
+
| `mcp` | the MCP server |
|
|
123
|
+
| `postgres` | Postgres + pgvector backend (with connection pooling) |
|
|
124
|
+
| `server` | FastAPI, uvicorn, Anthropic SDK |
|
|
125
|
+
| `dev` | everything + pytest/coverage |
|
|
126
|
+
|
|
127
|
+
Verify and run the tests:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
relio --help
|
|
131
|
+
pytest # 150+ tests (from a source clone)
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Quickstart (use the AI component)
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
from relio import RelioAI
|
|
140
|
+
|
|
141
|
+
ai = RelioAI(path="relio.db") # local SQLite + local embeddings, no LLM needed
|
|
142
|
+
ai.remember("Alice manages the Acme account")
|
|
143
|
+
print(ai.recall("who manages Acme?")[0].content) # -> "Alice manages the Acme account"
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Add an LLM when you want chat/extraction (set `ANTHROPIC_API_KEY`):
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
from relio import RelioAI
|
|
150
|
+
from relio.server.llm.claude import ClaudeProvider
|
|
151
|
+
|
|
152
|
+
ai = RelioAI(path="relio.db", provider=ClaudeProvider())
|
|
153
|
+
for chunk in ai.chat("what do you know about Acme?"):
|
|
154
|
+
print(chunk, end="")
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## Scaffold a full app
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
relio new myapp --web # FastAPI backend + React (Vite) frontend + generated SDK
|
|
161
|
+
cd myapp
|
|
162
|
+
relio dev # backend + Vite dev server on one URL
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
`relio new` also supports `--mobile` (Expo) and `--desktop` (Tauri), all on the
|
|
166
|
+
same generated TypeScript SDK.
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Core concepts
|
|
171
|
+
|
|
172
|
+
### The `RelioAI` seam — the called-in component
|
|
173
|
+
One object composing the AI-system components. The LLM is optional.
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
ai.remember(text, scope=...) # store ai.recall(query) # semantic retrieval
|
|
177
|
+
ai.embed(["a", "b"]) # batch embeddings ai.query(type=..., where=...) # structured filter
|
|
178
|
+
ai.add_node / add_edge / neighbors / traverse # knowledge graph
|
|
179
|
+
ai.chat(message) # agent loop (needs a provider)
|
|
180
|
+
ai.extract / ai.extract_file # structured / multimodal extraction
|
|
181
|
+
ai.mcp_server() # expose to external agents over MCP
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
### Exposure map — governed access to *your* data
|
|
185
|
+
Your app DB is private. The AI can call only what you declare, and see only the
|
|
186
|
+
fields you allow.
|
|
187
|
+
|
|
188
|
+
```python
|
|
189
|
+
@ai.tool
|
|
190
|
+
def lookup_account(name: str) -> dict:
|
|
191
|
+
row = db.get_account(name)
|
|
192
|
+
return ai.expose(row, fields=["name", "owner", "status"]) # cost/PII stay invisible
|
|
193
|
+
|
|
194
|
+
ai.call_tool("lookup_account", name="Acme")
|
|
195
|
+
# the same map auto-publishes as MCP tools: ai.mcp_server(include_tools=True)
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Agents — bounded contexts
|
|
199
|
+
Each agent gets its own memory namespace, tool slice, config, and session.
|
|
200
|
+
Private by default.
|
|
201
|
+
|
|
202
|
+
```python
|
|
203
|
+
billing = ai.agent("billing", tools=["lookup_account"], system="You handle billing.")
|
|
204
|
+
billing.remember("invoice 42 overdue") # not visible to other agents
|
|
205
|
+
billing.call_tool("refund", ...) # PermissionError — not in its slice
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Document extraction (AI beyond chat)
|
|
209
|
+
```python
|
|
210
|
+
bom = ai.extract_file("drawing.pdf", schema={"properties": {"part_no": {}, "qty": {}}})
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Run it as a server
|
|
214
|
+
```python
|
|
215
|
+
from relio import Memory
|
|
216
|
+
from relio.server import create_app
|
|
217
|
+
from relio.server.llm.claude import ClaudeProvider
|
|
218
|
+
|
|
219
|
+
app = create_app(Memory(path="relio.db"), ClaudeProvider()) # uvicorn app:app
|
|
220
|
+
# memory-only backend (no LLM): create_app(Memory())
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Endpoints: `POST /api/chat` (SSE), `/api/memory` CRUD + `/search` + `/query`,
|
|
224
|
+
`/api/history`, `/api/graph/neighbors`, `/api/health`. Identity comes from an
|
|
225
|
+
**auth hook** (`anonymous_auth` default, or `ApiKeyAuth`), never from the request
|
|
226
|
+
body — so tenants are isolated by construction.
|
|
227
|
+
|
|
228
|
+
---
|
|
229
|
+
|
|
230
|
+
## CLI
|
|
231
|
+
|
|
232
|
+
| Command | Does |
|
|
233
|
+
|---------|------|
|
|
234
|
+
| `relio new <name> [--web/--mobile/--desktop]` | scaffold an app (+ generated SDK + dev harness) |
|
|
235
|
+
| `relio dev` | run backend + frontend dev servers on one URL |
|
|
236
|
+
| `relio build` | build the React frontend |
|
|
237
|
+
| `relio serve [--port]` | serve API + built frontend on one port |
|
|
238
|
+
| `relio sdk [--out]` | generate the TS + Python SDKs from the API |
|
|
239
|
+
| `relio develop ["<task>"]` | drive the Claude Code CLI to build a feature (feeds gate gaps to it) |
|
|
240
|
+
| `relio test [--coverage --min N]` | run the test suites (optionally enforce coverage) |
|
|
241
|
+
| `relio check` | **governance gate** — fail if any module lacks a test and a doc |
|
|
242
|
+
| `relio dockerfile` / `relio deploy` | production Dockerfile / build image |
|
|
243
|
+
|
|
244
|
+
### The governance gate
|
|
245
|
+
A scaffolded app ships a `CLAUDE.md` (conventions), `docs/`, `tests/`, and a
|
|
246
|
+
`.claude/` Stop hook that runs `relio check`. The gate requires **every module
|
|
247
|
+
(Python and TypeScript) to have a test and a doc** — and a fresh scaffold passes
|
|
248
|
+
it out of the box. So agentic development with `relio develop` can't end with
|
|
249
|
+
undocumented or untested code.
|
|
250
|
+
|
|
251
|
+
---
|
|
252
|
+
|
|
253
|
+
## Backends & config
|
|
254
|
+
|
|
255
|
+
- **Default:** one SQLite file (vectors via `sqlite-vec`, WAL, indexed structured
|
|
256
|
+
query). Backups = copy the file.
|
|
257
|
+
- **Scale:** `Memory(database_url="postgresql://…")` swaps to **Postgres +
|
|
258
|
+
pgvector** (JSONB + GIN, connection pooling) — no caller changes.
|
|
259
|
+
- **Server config** via `RELIO_*` env (`RELIO_DATABASE_URL`, `RELIO_MODEL`, …).
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Project layout
|
|
264
|
+
|
|
265
|
+
```
|
|
266
|
+
relio/ # the framework package
|
|
267
|
+
ai.py # RelioAI seam exposure.py # exposure map
|
|
268
|
+
agents.py # bounded agents memory.py # the engine
|
|
269
|
+
backends/ # sqlite, postgres embedding/ # local + cache + batch
|
|
270
|
+
server/ # FastAPI app, routes, auth, llm providers, agent loop
|
|
271
|
+
cli/ # new/dev/serve/sdk/develop/test/check
|
|
272
|
+
templates/ # web (React), mobile (Expo), desktop (Tauri)
|
|
273
|
+
docs/superpowers/specs/ # design specs (architecture v2 + every feature)
|
|
274
|
+
tests/ # 150+ tests
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
Start with [`docs/superpowers/specs/2026-06-30-relio-architecture-v2-app-first.md`](docs/superpowers/specs/2026-06-30-relio-architecture-v2-app-first.md)
|
|
278
|
+
for the full architecture.
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## Status
|
|
283
|
+
|
|
284
|
+
| Area | State |
|
|
285
|
+
|------|-------|
|
|
286
|
+
| Engine, server, auth, graph, query, agents, SDK gen, scaffolds, CLI, dev harness | ✅ tested |
|
|
287
|
+
| Postgres + pgvector (backend, pooling, JSONB) | ⚙️ implemented; integration-gated (`RELIO_TEST_DATABASE_URL`, `pytest -m integration`) |
|
|
288
|
+
| Claude vision/extraction call | ⚙️ implemented; untested without an API key (the offline fake path is tested) |
|
|
289
|
+
| Generated TS SDK / mobile / desktop apps | ⚙️ scaffolded + structurally tested; not compiled in CI |
|
|
290
|
+
|
|
291
|
+
---
|
|
292
|
+
|
|
293
|
+
## License
|
|
294
|
+
|
|
295
|
+
Intended **open-core**: the framework is MIT (see [LICENSE](LICENSE)); a future
|
|
296
|
+
managed cloud + enterprise components are separately licensed. See the project's
|
|
297
|
+
licensing notes.
|
|
298
|
+
|
|
299
|
+
## Contributing
|
|
300
|
+
|
|
301
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md). In short: tests-first, every change keeps
|
|
302
|
+
the suite green, and design specs live under `docs/superpowers/specs/`.
|