smrititantra 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.
Files changed (181) hide show
  1. smrititantra-0.1.0/.env.example +23 -0
  2. smrititantra-0.1.0/.github/workflows/ci.yml +37 -0
  3. smrititantra-0.1.0/.github/workflows/docs.yml +33 -0
  4. smrititantra-0.1.0/.github/workflows/release.yml +60 -0
  5. smrititantra-0.1.0/.gitignore +60 -0
  6. smrititantra-0.1.0/.pre-commit-config.yaml +26 -0
  7. smrititantra-0.1.0/.python-version +1 -0
  8. smrititantra-0.1.0/LICENSE +201 -0
  9. smrititantra-0.1.0/PKG-INFO +144 -0
  10. smrititantra-0.1.0/README.md +72 -0
  11. smrititantra-0.1.0/docker/Dockerfile.service +25 -0
  12. smrititantra-0.1.0/docker/docker-compose.yml +134 -0
  13. smrititantra-0.1.0/docs/architecture.md +96 -0
  14. smrititantra-0.1.0/docs/cli.md +67 -0
  15. smrititantra-0.1.0/docs/http-api.md +103 -0
  16. smrititantra-0.1.0/docs/index.md +45 -0
  17. smrititantra-0.1.0/docs/install.md +45 -0
  18. smrititantra-0.1.0/docs/reference/exceptions.md +3 -0
  19. smrititantra-0.1.0/docs/reference/facade.md +13 -0
  20. smrititantra-0.1.0/docs/reference/gaps.md +3 -0
  21. smrititantra-0.1.0/docs/reference/graph.md +3 -0
  22. smrititantra-0.1.0/docs/reference/index.md +5 -0
  23. smrititantra-0.1.0/docs/reference/models.md +3 -0
  24. smrititantra-0.1.0/docs/reference/snapshot.md +3 -0
  25. smrititantra-0.1.0/examples/agent_loop.py +102 -0
  26. smrititantra-0.1.0/examples/http_client.py +39 -0
  27. smrititantra-0.1.0/examples/library_usage.py +70 -0
  28. smrititantra-0.1.0/examples/mcp_config.json +13 -0
  29. smrititantra-0.1.0/mkdocs.yml +58 -0
  30. smrititantra-0.1.0/pyproject.toml +122 -0
  31. smrititantra-0.1.0/ruff.toml +77 -0
  32. smrititantra-0.1.0/scripts/bench.py +93 -0
  33. smrititantra-0.1.0/scripts/dev-all.sh +69 -0
  34. smrititantra-0.1.0/scripts/dev-minio.sh +72 -0
  35. smrititantra-0.1.0/scripts/dev-neo4j.sh +79 -0
  36. smrititantra-0.1.0/scripts/dev-postgres.sh +116 -0
  37. smrititantra-0.1.0/scripts/dev-qdrant.sh +69 -0
  38. smrititantra-0.1.0/scripts/test-layering.sh +42 -0
  39. smrititantra-0.1.0/src/smrititantra/__init__.py +50 -0
  40. smrititantra-0.1.0/src/smrititantra/backends/__init__.py +1 -0
  41. smrititantra-0.1.0/src/smrititantra/backends/remote_http.py +382 -0
  42. smrititantra-0.1.0/src/smrititantra/cli.py +1443 -0
  43. smrititantra-0.1.0/src/smrititantra/client.py +76 -0
  44. smrititantra-0.1.0/src/smrititantra/config.py +408 -0
  45. smrititantra-0.1.0/src/smrititantra/core/__init__.py +1 -0
  46. smrititantra-0.1.0/src/smrititantra/core/artifacts.py +277 -0
  47. smrititantra-0.1.0/src/smrititantra/core/backends/__init__.py +1 -0
  48. smrititantra-0.1.0/src/smrititantra/core/cards.py +131 -0
  49. smrititantra-0.1.0/src/smrititantra/core/connectors/__init__.py +1 -0
  50. smrititantra-0.1.0/src/smrititantra/core/connectors/base.py +182 -0
  51. smrititantra-0.1.0/src/smrititantra/core/connectors/files.py +110 -0
  52. smrititantra-0.1.0/src/smrititantra/core/connectors/mongodb.py +189 -0
  53. smrititantra-0.1.0/src/smrititantra/core/connectors/postgres.py +293 -0
  54. smrititantra-0.1.0/src/smrititantra/core/content.py +73 -0
  55. smrititantra-0.1.0/src/smrititantra/core/coverage.py +320 -0
  56. smrititantra-0.1.0/src/smrititantra/core/embed.py +154 -0
  57. smrititantra-0.1.0/src/smrititantra/core/engine/__init__.py +1 -0
  58. smrititantra-0.1.0/src/smrititantra/core/engine/activation.py +401 -0
  59. smrititantra-0.1.0/src/smrititantra/core/engine/masks.py +110 -0
  60. smrititantra-0.1.0/src/smrititantra/core/engine/recall.py +606 -0
  61. smrititantra-0.1.0/src/smrititantra/core/engine/snapshot.py +980 -0
  62. smrititantra-0.1.0/src/smrititantra/core/exec_edge.py +359 -0
  63. smrititantra-0.1.0/src/smrititantra/core/gaps.py +745 -0
  64. smrititantra-0.1.0/src/smrititantra/core/gc.py +130 -0
  65. smrititantra-0.1.0/src/smrititantra/core/grammar.py +169 -0
  66. smrititantra-0.1.0/src/smrititantra/core/graph_store.py +606 -0
  67. smrititantra-0.1.0/src/smrititantra/core/importers/__init__.py +1 -0
  68. smrititantra-0.1.0/src/smrititantra/core/importers/base.py +226 -0
  69. smrititantra-0.1.0/src/smrititantra/core/importers/dbt.py +293 -0
  70. smrititantra-0.1.0/src/smrititantra/core/intake.py +96 -0
  71. smrititantra-0.1.0/src/smrititantra/core/interchange.py +170 -0
  72. smrititantra-0.1.0/src/smrititantra/core/learning/__init__.py +1 -0
  73. smrititantra-0.1.0/src/smrititantra/core/learning/consolidate.py +323 -0
  74. smrititantra-0.1.0/src/smrititantra/core/learning/evaluate.py +304 -0
  75. smrititantra-0.1.0/src/smrititantra/core/learning/extract.py +126 -0
  76. smrititantra-0.1.0/src/smrititantra/core/learning/miner.py +298 -0
  77. smrititantra-0.1.0/src/smrititantra/core/ledger.py +178 -0
  78. smrititantra-0.1.0/src/smrititantra/core/llm.py +78 -0
  79. smrititantra-0.1.0/src/smrititantra/core/planes/__init__.py +1 -0
  80. smrititantra-0.1.0/src/smrititantra/core/planes/assets.py +497 -0
  81. smrititantra-0.1.0/src/smrititantra/core/planes/bindings.py +342 -0
  82. smrititantra-0.1.0/src/smrititantra/core/planes/concepts.py +676 -0
  83. smrititantra-0.1.0/src/smrititantra/core/planes/episodes.py +382 -0
  84. smrititantra-0.1.0/src/smrititantra/core/planes/subjects.py +495 -0
  85. smrititantra-0.1.0/src/smrititantra/core/planes/workload.py +368 -0
  86. smrititantra-0.1.0/src/smrititantra/core/reviews.py +123 -0
  87. smrititantra-0.1.0/src/smrititantra/core/router.py +263 -0
  88. smrititantra-0.1.0/src/smrititantra/core/search.py +308 -0
  89. smrititantra-0.1.0/src/smrititantra/core/store/__init__.py +1 -0
  90. smrititantra-0.1.0/src/smrititantra/core/store/base.py +388 -0
  91. smrititantra-0.1.0/src/smrititantra/core/store/memory.py +712 -0
  92. smrititantra-0.1.0/src/smrititantra/core/store/migrations/0001_init.sql +249 -0
  93. smrititantra-0.1.0/src/smrititantra/core/store/postgres.py +1180 -0
  94. smrititantra-0.1.0/src/smrititantra/core/telemetry.py +173 -0
  95. smrititantra-0.1.0/src/smrititantra/core/tenancy.py +358 -0
  96. smrititantra-0.1.0/src/smrititantra/core/vector_index.py +439 -0
  97. smrititantra-0.1.0/src/smrititantra/core/workers.py +224 -0
  98. smrititantra-0.1.0/src/smrititantra/exceptions.py +215 -0
  99. smrititantra-0.1.0/src/smrititantra/local.py +1425 -0
  100. smrititantra-0.1.0/src/smrititantra/mcp_server/__init__.py +1 -0
  101. smrititantra-0.1.0/src/smrititantra/mcp_server/server.py +327 -0
  102. smrititantra-0.1.0/src/smrititantra/models.py +301 -0
  103. smrititantra-0.1.0/src/smrititantra/py.typed +0 -0
  104. smrititantra-0.1.0/src/smrititantra/server/__init__.py +1 -0
  105. smrititantra-0.1.0/src/smrititantra/server/app.py +692 -0
  106. smrititantra-0.1.0/src/smrititantra/server/auth.py +146 -0
  107. smrititantra-0.1.0/src/smrititantra/server/errors.py +44 -0
  108. smrititantra-0.1.0/src/smrititantra/server/routes/__init__.py +1 -0
  109. smrititantra-0.1.0/src/smrititantra/server/schemas.py +79 -0
  110. smrititantra-0.1.0/src/smrititantra/sync.py +106 -0
  111. smrititantra-0.1.0/src/smrititantra/templates/console.html +332 -0
  112. smrititantra-0.1.0/src/smrititantra/templates/corpus.json +23 -0
  113. smrititantra-0.1.0/src/smrititantra/templates/knowledge/concepts/customer.md +17 -0
  114. smrititantra-0.1.0/src/smrititantra/templates/knowledge/metrics/net_revenue.md +30 -0
  115. smrititantra-0.1.0/src/smrititantra/templates/knowledge/rules/exclude_test_accounts.md +23 -0
  116. smrititantra-0.1.0/src/smrititantra/templates/knowledge/sops/monthly_close.md +17 -0
  117. smrititantra-0.1.0/src/smrititantra/templates/smrititantra.yaml +65 -0
  118. smrititantra-0.1.0/tests/golden/openapi_v1.json +190 -0
  119. smrititantra-0.1.0/tests/golden/replay_set.jsonl +3 -0
  120. smrititantra-0.1.0/tests/integration/test_bench.py +39 -0
  121. smrititantra-0.1.0/tests/integration/test_end_to_end.py +112 -0
  122. smrititantra-0.1.0/tests/integration/test_leaks.py +71 -0
  123. smrititantra-0.1.0/tests/unit/test_acceptance.py +352 -0
  124. smrititantra-0.1.0/tests/unit/test_activation.py +323 -0
  125. smrititantra-0.1.0/tests/unit/test_artifacts.py +208 -0
  126. smrititantra-0.1.0/tests/unit/test_artifacts_s3_live.py +46 -0
  127. smrititantra-0.1.0/tests/unit/test_assets_workload.py +465 -0
  128. smrititantra-0.1.0/tests/unit/test_backend_parity.py +159 -0
  129. smrititantra-0.1.0/tests/unit/test_bindings.py +340 -0
  130. smrititantra-0.1.0/tests/unit/test_breadth_connectors.py +93 -0
  131. smrititantra-0.1.0/tests/unit/test_card_index.py +132 -0
  132. smrititantra-0.1.0/tests/unit/test_cli.py +1480 -0
  133. smrititantra-0.1.0/tests/unit/test_compose.py +84 -0
  134. smrititantra-0.1.0/tests/unit/test_concepts.py +587 -0
  135. smrititantra-0.1.0/tests/unit/test_config.py +152 -0
  136. smrititantra-0.1.0/tests/unit/test_connector_postgres.py +109 -0
  137. smrititantra-0.1.0/tests/unit/test_consolidate.py +308 -0
  138. smrititantra-0.1.0/tests/unit/test_consumer_surface.py +281 -0
  139. smrititantra-0.1.0/tests/unit/test_content_grammar.py +120 -0
  140. smrititantra-0.1.0/tests/unit/test_coverage.py +256 -0
  141. smrititantra-0.1.0/tests/unit/test_demo_intake.py +120 -0
  142. smrititantra-0.1.0/tests/unit/test_drift.py +233 -0
  143. smrititantra-0.1.0/tests/unit/test_embed_cards.py +248 -0
  144. smrititantra-0.1.0/tests/unit/test_episodes.py +251 -0
  145. smrititantra-0.1.0/tests/unit/test_eval_completeness.py +324 -0
  146. smrititantra-0.1.0/tests/unit/test_examples.py +59 -0
  147. smrititantra-0.1.0/tests/unit/test_exec_edge.py +408 -0
  148. smrititantra-0.1.0/tests/unit/test_export.py +132 -0
  149. smrititantra-0.1.0/tests/unit/test_extract.py +227 -0
  150. smrititantra-0.1.0/tests/unit/test_facade.py +153 -0
  151. smrititantra-0.1.0/tests/unit/test_gap_breadth.py +337 -0
  152. smrititantra-0.1.0/tests/unit/test_gaps.py +305 -0
  153. smrititantra-0.1.0/tests/unit/test_gc.py +121 -0
  154. smrititantra-0.1.0/tests/unit/test_graph.py +244 -0
  155. smrititantra-0.1.0/tests/unit/test_graph_neo4j.py +409 -0
  156. smrititantra-0.1.0/tests/unit/test_http.py +325 -0
  157. smrititantra-0.1.0/tests/unit/test_import_quality_lineage.py +172 -0
  158. smrititantra-0.1.0/tests/unit/test_importers.py +206 -0
  159. smrititantra-0.1.0/tests/unit/test_interchange.py +152 -0
  160. smrititantra-0.1.0/tests/unit/test_ledger.py +81 -0
  161. smrititantra-0.1.0/tests/unit/test_mcp.py +154 -0
  162. smrititantra-0.1.0/tests/unit/test_miner.py +235 -0
  163. smrititantra-0.1.0/tests/unit/test_model_exceptions.py +97 -0
  164. smrititantra-0.1.0/tests/unit/test_operator_surface.py +262 -0
  165. smrititantra-0.1.0/tests/unit/test_publish_gate.py +131 -0
  166. smrititantra-0.1.0/tests/unit/test_recall.py +405 -0
  167. smrititantra-0.1.0/tests/unit/test_reviews.py +135 -0
  168. smrititantra-0.1.0/tests/unit/test_router.py +218 -0
  169. smrititantra-0.1.0/tests/unit/test_routes.py +275 -0
  170. smrititantra-0.1.0/tests/unit/test_scaffold.py +31 -0
  171. smrititantra-0.1.0/tests/unit/test_scale_kit.py +262 -0
  172. smrititantra-0.1.0/tests/unit/test_search.py +228 -0
  173. smrititantra-0.1.0/tests/unit/test_snapshot.py +475 -0
  174. smrititantra-0.1.0/tests/unit/test_sop_gap.py +107 -0
  175. smrititantra-0.1.0/tests/unit/test_store.py +332 -0
  176. smrititantra-0.1.0/tests/unit/test_store_postgres.py +102 -0
  177. smrititantra-0.1.0/tests/unit/test_subjects.py +249 -0
  178. smrititantra-0.1.0/tests/unit/test_telemetry.py +57 -0
  179. smrititantra-0.1.0/tests/unit/test_tenancy.py +272 -0
  180. smrititantra-0.1.0/tests/unit/test_vector_index.py +187 -0
  181. smrititantra-0.1.0/tests/unit/test_workers.py +171 -0
@@ -0,0 +1,23 @@
1
+ # Copy to `.env` for the compose stack. Everything here has a safe default in
2
+ # docker-compose.yml; override for anything beyond local development.
3
+
4
+ # --- Postgres (the source of truth; stateful volume) -----------------------
5
+ POSTGRES_PASSWORD=smrititantra
6
+
7
+ # --- MinIO / S3 (artifacts: snapshots, datasets, large bodies) -------------
8
+ MINIO_ROOT_USER=minioadmin
9
+ MINIO_ROOT_PASSWORD=minioadmin
10
+ SMRITITANTRA_ARTIFACTS_S3_BUCKET=smrititantra
11
+
12
+ # --- Auth ------------------------------------------------------------------
13
+ # Set a token OR issue API keys (`smrititantra keys issue`). Leaving BOTH empty runs
14
+ # the service in OPEN DEV MODE (loud warning) — never do that in production.
15
+ SMRITITANTRA_AUTH_TOKEN=
16
+
17
+ # --- Embeddings (optional; unset -> dense recall channel is off) -----------
18
+ # Any OpenAI-compatible /embeddings endpoint (OpenAI, LiteLLM, Ollama, vLLM).
19
+ SMRITITANTRA_EMBED_URL=
20
+ SMRITITANTRA_EMBED_MODEL=
21
+
22
+ # --- Optional profiles -----------------------------------------------------
23
+ # NEO4J_PASSWORD=smrititantra-graph # --profile graph
@@ -0,0 +1,37 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Install uv
15
+ uses: astral-sh/setup-uv@v3
16
+ with:
17
+ python-version: "3.12"
18
+
19
+ - name: Install (every extra + dev)
20
+ run: |
21
+ uv venv
22
+ uv pip install -e ".[all,dev]"
23
+
24
+ - name: ruff check
25
+ run: .venv/bin/ruff check src tests scripts
26
+
27
+ - name: ruff format --check
28
+ run: .venv/bin/ruff format --check src tests scripts
29
+
30
+ - name: mypy --strict
31
+ run: .venv/bin/mypy --strict src tests
32
+
33
+ - name: pytest
34
+ run: .venv/bin/pytest -q
35
+
36
+ - name: layering matrix
37
+ run: bash scripts/test-layering.sh
@@ -0,0 +1,33 @@
1
+ name: Docs
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+
7
+ permissions:
8
+ contents: write
9
+
10
+ jobs:
11
+ build-and-deploy:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Install uv
17
+ uses: astral-sh/setup-uv@v3
18
+ with:
19
+ python-version: "3.12"
20
+
21
+ - name: Install (docs + every extra, so autodoc can resolve every module)
22
+ run: |
23
+ uv venv
24
+ uv pip install -e ".[all,docs]"
25
+
26
+ - name: Build (strict — a broken autodoc ref fails the job)
27
+ run: .venv/bin/mkdocs build --strict
28
+
29
+ - name: Deploy to GitHub Pages
30
+ run: |
31
+ git config user.name "github-actions[bot]"
32
+ git config user.email "github-actions[bot]@users.noreply.github.com"
33
+ .venv/bin/mkdocs gh-deploy --force
@@ -0,0 +1,60 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags: ["v*.*.*"]
6
+ workflow_dispatch: {} # manual: dry-run a TestPyPI publish before tagging
7
+
8
+ jobs:
9
+ build:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+
14
+ - name: Install uv
15
+ uses: astral-sh/setup-uv@v3
16
+ with:
17
+ python-version: "3.12"
18
+
19
+ - name: Build sdist + wheel
20
+ run: uv build
21
+
22
+ - name: twine check
23
+ run: uv run --with twine twine check dist/*
24
+
25
+ - uses: actions/upload-artifact@v4
26
+ with:
27
+ name: dist
28
+ path: dist/
29
+
30
+ publish-testpypi:
31
+ # manual dry run only — never fires on a tag push
32
+ if: github.event_name == 'workflow_dispatch'
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ environment: testpypi
36
+ permissions:
37
+ id-token: write # PyPI trusted publishing (OIDC) — no stored token
38
+ steps:
39
+ - uses: actions/download-artifact@v4
40
+ with:
41
+ name: dist
42
+ path: dist/
43
+ - uses: pypa/gh-action-pypi-publish@release/v1
44
+ with:
45
+ repository-url: https://test.pypi.org/legacy/
46
+
47
+ publish-pypi:
48
+ # the real release — only on a version tag
49
+ if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
50
+ needs: build
51
+ runs-on: ubuntu-latest
52
+ environment: pypi
53
+ permissions:
54
+ id-token: write # PyPI trusted publishing (OIDC) — no stored token
55
+ steps:
56
+ - uses: actions/download-artifact@v4
57
+ with:
58
+ name: dist
59
+ path: dist/
60
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,60 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ build/
7
+ dist/
8
+ wheels/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv
14
+ env/
15
+ venv/
16
+ ENV/
17
+ env.bak/
18
+ venv.bak/
19
+
20
+ # Caches and tests
21
+ .mypy_cache/
22
+ .pytest_cache/
23
+ .ruff_cache/
24
+ .coverage
25
+ htmlcov/
26
+ .tox/
27
+ nosetests.xml
28
+ coverage.xml
29
+ *.cover
30
+ *.py,cover
31
+
32
+ # Local runtime state (default artifacts_dir, etc.)
33
+ .smrititantra/
34
+
35
+ # Built docs site (mkdocs build)
36
+ site/
37
+
38
+ # IDEs
39
+ .idea/
40
+ .vscode/
41
+ *.swp
42
+ *.swo
43
+
44
+ # Ignore all .env files in all nested directories
45
+ .env
46
+ .env.*
47
+ *.env
48
+ **/.env
49
+ **/.env.*
50
+ **/*.env
51
+
52
+ # Keep example/sample env files tracked
53
+ !example.env
54
+ !sample.env
55
+ !**/example.env
56
+ !**/sample.env
57
+ !.env.sample
58
+ !**/.env.sample
59
+ !.env.example
60
+ !**/.env.example
@@ -0,0 +1,26 @@
1
+ # Run `pre-commit install` one time to set it up
2
+ # Run `pre-commit autoupdate` on every update
3
+ repos:
4
+ - repo: https://github.com/astral-sh/ruff-pre-commit
5
+ # Ruff version.
6
+ rev: v0.15.17
7
+ hooks:
8
+ # Run the linter.
9
+ - id: ruff-check
10
+ args: [ --fix ]
11
+ # Run the formatter.
12
+ - id: ruff-format
13
+ - repo: https://github.com/pre-commit/mirrors-mypy
14
+ rev: v1.11.1
15
+ hooks:
16
+ - id: mypy
17
+ args: [ --strict ]
18
+ additional_dependencies: [pydantic, pydantic-settings, pytest, httpx, fastapi, uvicorn, python-multipart, "mcp>=2"]
19
+ - repo: local
20
+ hooks:
21
+ - id: pytest
22
+ name: pytest
23
+ entry: pytest
24
+ language: system
25
+ types: [python]
26
+ pass_filenames: false
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing
141
+ the origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2026 Daksh Gaur
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.5
2
+ Name: smrititantra
3
+ Version: 0.1.0
4
+ Summary: Memory for AI agents: ingest, recall, learn - library, HTTP service, and MCP server over one async core
5
+ Project-URL: Homepage, https://github.com/NoesisResearch/smrititantra
6
+ Project-URL: Repository, https://github.com/NoesisResearch/smrititantra
7
+ Project-URL: Issues, https://github.com/NoesisResearch/smrititantra/issues
8
+ Author: Daksh Gaur
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ Keywords: agents,ai,mcp,memory,rag,semantic-layer
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Classifier: Typing :: Typed
18
+ Requires-Python: >=3.12
19
+ Requires-Dist: httpx>=0.27
20
+ Requires-Dist: pydantic-settings>=2.14.1
21
+ Requires-Dist: pydantic>=2.13.4
22
+ Provides-Extra: all
23
+ Requires-Dist: aioboto3>=13; extra == 'all'
24
+ Requires-Dist: asyncpg>=0.29; extra == 'all'
25
+ Requires-Dist: fastapi>=0.110; extra == 'all'
26
+ Requires-Dist: mcp>=2; extra == 'all'
27
+ Requires-Dist: motor>=3.4; extra == 'all'
28
+ Requires-Dist: neo4j>=5; extra == 'all'
29
+ Requires-Dist: numpy>=1.26; extra == 'all'
30
+ Requires-Dist: opentelemetry-api>=1.27; extra == 'all'
31
+ Requires-Dist: opentelemetry-sdk>=1.27; extra == 'all'
32
+ Requires-Dist: python-multipart>=0.0.9; extra == 'all'
33
+ Requires-Dist: pyyaml>=6; extra == 'all'
34
+ Requires-Dist: qdrant-client>=1; extra == 'all'
35
+ Requires-Dist: sqlglot>=25; extra == 'all'
36
+ Requires-Dist: uvicorn>=0.29; extra == 'all'
37
+ Provides-Extra: dev
38
+ Requires-Dist: httpx2>=2; extra == 'dev'
39
+ Requires-Dist: mypy>=1.14.1; extra == 'dev'
40
+ Requires-Dist: pre-commit>=4.6.0; extra == 'dev'
41
+ Requires-Dist: psutil>=6; extra == 'dev'
42
+ Requires-Dist: pytest-asyncio>=1.4.0; extra == 'dev'
43
+ Requires-Dist: pytest>=8.3.4; extra == 'dev'
44
+ Requires-Dist: ruff>=0.15.17; extra == 'dev'
45
+ Requires-Dist: twine>=6; extra == 'dev'
46
+ Provides-Extra: docs
47
+ Requires-Dist: mkdocs-material>=9.5; extra == 'docs'
48
+ Requires-Dist: mkdocs>=1.6; extra == 'docs'
49
+ Requires-Dist: mkdocstrings[python]>=0.26; extra == 'docs'
50
+ Provides-Extra: local
51
+ Requires-Dist: asyncpg>=0.29; extra == 'local'
52
+ Requires-Dist: numpy>=1.26; extra == 'local'
53
+ Requires-Dist: pyyaml>=6; extra == 'local'
54
+ Requires-Dist: sqlglot>=25; extra == 'local'
55
+ Provides-Extra: mongo
56
+ Requires-Dist: motor>=3.4; extra == 'mongo'
57
+ Provides-Extra: neo4j
58
+ Requires-Dist: neo4j>=5; extra == 'neo4j'
59
+ Provides-Extra: otel
60
+ Requires-Dist: opentelemetry-api>=1.27; extra == 'otel'
61
+ Requires-Dist: opentelemetry-sdk>=1.27; extra == 'otel'
62
+ Provides-Extra: qdrant
63
+ Requires-Dist: qdrant-client>=1; extra == 'qdrant'
64
+ Provides-Extra: s3
65
+ Requires-Dist: aioboto3>=13; extra == 's3'
66
+ Provides-Extra: server
67
+ Requires-Dist: fastapi>=0.110; extra == 'server'
68
+ Requires-Dist: mcp>=2; extra == 'server'
69
+ Requires-Dist: python-multipart>=0.0.9; extra == 'server'
70
+ Requires-Dist: uvicorn>=0.29; extra == 'server'
71
+ Description-Content-Type: text/markdown
72
+
73
+ # SmritiTantra
74
+
75
+ Memory for AI agents: ingest, recall, learn — one shared async core, served
76
+ three ways: embedded in your process, over HTTP, or as an MCP server.
77
+
78
+ [Full documentation →](https://noesisresearch.github.io/smrititantra/)
79
+
80
+ ## Install
81
+
82
+ A bare install is a lightweight remote SDK (`smrititantra.connect()`, models,
83
+ exceptions, the sync facade):
84
+
85
+ ```bash
86
+ pip install smrititantra
87
+ ```
88
+
89
+ Everything heavier lives behind an extra — mix in what you need:
90
+
91
+ ```bash
92
+ pip install "smrititantra[local]" # embedded engine + Postgres store
93
+ pip install "smrititantra[server]" # HTTP + MCP service
94
+ pip install "smrititantra[all]" # local + server + every scale backend
95
+ ```
96
+
97
+ | Extra | Adds |
98
+ |----------|------|
99
+ | `local` | the embedded engine, Postgres store |
100
+ | `server` | the FastAPI HTTP service + MCP server |
101
+ | `s3` | S3/MinIO artifact store |
102
+ | `qdrant` | Qdrant vector-index backend at scale |
103
+ | `neo4j` | Neo4j graph-serving tier at scale |
104
+ | `mongo` | MongoDB source connector |
105
+ | `otel` | OpenTelemetry tracing spans |
106
+
107
+ ## Quickstart
108
+
109
+ ```python
110
+ import asyncio
111
+ from smrititantra import Smrititantra
112
+
113
+ async def main() -> None:
114
+ async with Smrititantra() as smriti:
115
+ await smriti.concepts.author(
116
+ kind="metric", name="net_revenue",
117
+ metadata={"title": "Net Revenue", "description": "Gross minus refunds."},
118
+ body="Net revenue is gross order value minus refunds.",
119
+ )
120
+ await smriti.snapshots.compile()
121
+ pack = await smriti.recall("what is net revenue")
122
+ print(pack.confidence, [i.ref for i in pack.required])
123
+
124
+ asyncio.run(main())
125
+ ```
126
+
127
+ Or try the self-contained demo (no database or config needed):
128
+
129
+ ```bash
130
+ pip install "smrititantra[local]"
131
+ smrititantra demo
132
+ ```
133
+
134
+ ## CLI
135
+
136
+ `smrititantra --help` covers the full surface: `orgs`, `sources`, `sync`,
137
+ `import`, `mine-workload`, `mine`, `coverage`, `gaps`, `reviews`, `compile`,
138
+ `recall`, `search`, `get`, `graph`, `snapshots`, `config`, `agents`, `keys`,
139
+ `serve`, `mcp`, `demo`, `init`. Details in the
140
+ [CLI reference](https://noesisresearch.github.io/smrititantra/cli/).
141
+
142
+ ## License
143
+
144
+ Apache-2.0 — see [LICENSE](LICENSE).
@@ -0,0 +1,72 @@
1
+ # SmritiTantra
2
+
3
+ Memory for AI agents: ingest, recall, learn — one shared async core, served
4
+ three ways: embedded in your process, over HTTP, or as an MCP server.
5
+
6
+ [Full documentation →](https://noesisresearch.github.io/smrititantra/)
7
+
8
+ ## Install
9
+
10
+ A bare install is a lightweight remote SDK (`smrititantra.connect()`, models,
11
+ exceptions, the sync facade):
12
+
13
+ ```bash
14
+ pip install smrititantra
15
+ ```
16
+
17
+ Everything heavier lives behind an extra — mix in what you need:
18
+
19
+ ```bash
20
+ pip install "smrititantra[local]" # embedded engine + Postgres store
21
+ pip install "smrititantra[server]" # HTTP + MCP service
22
+ pip install "smrititantra[all]" # local + server + every scale backend
23
+ ```
24
+
25
+ | Extra | Adds |
26
+ |----------|------|
27
+ | `local` | the embedded engine, Postgres store |
28
+ | `server` | the FastAPI HTTP service + MCP server |
29
+ | `s3` | S3/MinIO artifact store |
30
+ | `qdrant` | Qdrant vector-index backend at scale |
31
+ | `neo4j` | Neo4j graph-serving tier at scale |
32
+ | `mongo` | MongoDB source connector |
33
+ | `otel` | OpenTelemetry tracing spans |
34
+
35
+ ## Quickstart
36
+
37
+ ```python
38
+ import asyncio
39
+ from smrititantra import Smrititantra
40
+
41
+ async def main() -> None:
42
+ async with Smrititantra() as smriti:
43
+ await smriti.concepts.author(
44
+ kind="metric", name="net_revenue",
45
+ metadata={"title": "Net Revenue", "description": "Gross minus refunds."},
46
+ body="Net revenue is gross order value minus refunds.",
47
+ )
48
+ await smriti.snapshots.compile()
49
+ pack = await smriti.recall("what is net revenue")
50
+ print(pack.confidence, [i.ref for i in pack.required])
51
+
52
+ asyncio.run(main())
53
+ ```
54
+
55
+ Or try the self-contained demo (no database or config needed):
56
+
57
+ ```bash
58
+ pip install "smrititantra[local]"
59
+ smrititantra demo
60
+ ```
61
+
62
+ ## CLI
63
+
64
+ `smrititantra --help` covers the full surface: `orgs`, `sources`, `sync`,
65
+ `import`, `mine-workload`, `mine`, `coverage`, `gaps`, `reviews`, `compile`,
66
+ `recall`, `search`, `get`, `graph`, `snapshots`, `config`, `agents`, `keys`,
67
+ `serve`, `mcp`, `demo`, `init`. Details in the
68
+ [CLI reference](https://noesisresearch.github.io/smrititantra/cli/).
69
+
70
+ ## License
71
+
72
+ Apache-2.0 — see [LICENSE](LICENSE).