zettelforge 2.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 (131) hide show
  1. zettelforge-2.1.0/.github/ISSUE_TEMPLATE/bug_report.md +30 -0
  2. zettelforge-2.1.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
  3. zettelforge-2.1.0/.github/SECURITY.md +33 -0
  4. zettelforge-2.1.0/.github/pull_request_template.md +18 -0
  5. zettelforge-2.1.0/.github/workflows/ci.yml +76 -0
  6. zettelforge-2.1.0/.github/workflows/publish.yml +28 -0
  7. zettelforge-2.1.0/.gitignore +67 -0
  8. zettelforge-2.1.0/CHANGELOG.md +85 -0
  9. zettelforge-2.1.0/CODE_OF_CONDUCT.md +40 -0
  10. zettelforge-2.1.0/CONTRIBUTING.md +70 -0
  11. zettelforge-2.1.0/LICENSE +21 -0
  12. zettelforge-2.1.0/LICENSE-ENTERPRISE +20 -0
  13. zettelforge-2.1.0/MANIFEST.in +7 -0
  14. zettelforge-2.1.0/PACKAGE_SUMMARY.md +174 -0
  15. zettelforge-2.1.0/PKG-INFO +279 -0
  16. zettelforge-2.1.0/README.md +235 -0
  17. zettelforge-2.1.0/SKILL.md +158 -0
  18. zettelforge-2.1.0/benchmarks/BENCHMARK_REPORT.md +237 -0
  19. zettelforge-2.1.0/benchmarks/LOCOMO_BENCHMARK_COMPARISON.md +108 -0
  20. zettelforge-2.1.0/benchmarks/auto_ralph.py +94 -0
  21. zettelforge-2.1.0/benchmarks/benchmark_harness.py +121 -0
  22. zettelforge-2.1.0/benchmarks/cti_retrieval_benchmark.py +237 -0
  23. zettelforge-2.1.0/benchmarks/cti_retrieval_results.json +79 -0
  24. zettelforge-2.1.0/benchmarks/ctibench_benchmark.py +414 -0
  25. zettelforge-2.1.0/benchmarks/ctibench_results.json +849 -0
  26. zettelforge-2.1.0/benchmarks/dataset.json +30 -0
  27. zettelforge-2.1.0/benchmarks/graph_test.py +50 -0
  28. zettelforge-2.1.0/benchmarks/locomo_benchmark.py +534 -0
  29. zettelforge-2.1.0/benchmarks/locomo_results.json +962 -0
  30. zettelforge-2.1.0/benchmarks/locomo_results_v1.3.0_baseline.json +962 -0
  31. zettelforge-2.1.0/benchmarks/memoryagentbench.py +301 -0
  32. zettelforge-2.1.0/benchmarks/memoryagentbench_results.json +43 -0
  33. zettelforge-2.1.0/benchmarks/mempalace_benchmark.py +262 -0
  34. zettelforge-2.1.0/benchmarks/mempalace_results.json +955 -0
  35. zettelforge-2.1.0/benchmarks/naive_memory.py +52 -0
  36. zettelforge-2.1.0/benchmarks/ragas_benchmark.py +261 -0
  37. zettelforge-2.1.0/benchmarks/ragas_results.json +47 -0
  38. zettelforge-2.1.0/benchmarks/results/benchmark_report.md +1 -0
  39. zettelforge-2.1.0/benchmarks/results/ralph_optimization_log.json +114 -0
  40. zettelforge-2.1.0/config.default.yaml +315 -0
  41. zettelforge-2.1.0/config.example.yaml +143 -0
  42. zettelforge-2.1.0/docker/docker-compose.yml +17 -0
  43. zettelforge-2.1.0/docs/.ralph/mission_queue.json +14 -0
  44. zettelforge-2.1.0/docs/.ralph/progress.md +21 -0
  45. zettelforge-2.1.0/docs/explanation/architecture.md +110 -0
  46. zettelforge-2.1.0/docs/explanation/epistemic-tiers.md +89 -0
  47. zettelforge-2.1.0/docs/explanation/stix-in-zettelforge.md +116 -0
  48. zettelforge-2.1.0/docs/explanation/two-phase-pipeline.md +101 -0
  49. zettelforge-2.1.0/docs/explanation/zettelkasten-philosophy.md +80 -0
  50. zettelforge-2.1.0/docs/how-to/configure-lancedb.md +176 -0
  51. zettelforge-2.1.0/docs/how-to/configure-typedb.md +217 -0
  52. zettelforge-2.1.0/docs/how-to/ingest-news-report.md +162 -0
  53. zettelforge-2.1.0/docs/how-to/integrate-nexus-agent.md +230 -0
  54. zettelforge-2.1.0/docs/how-to/query-apt-tools.md +154 -0
  55. zettelforge-2.1.0/docs/how-to/resolve-aliases.md +163 -0
  56. zettelforge-2.1.0/docs/how-to/run-temporal-query.md +159 -0
  57. zettelforge-2.1.0/docs/how-to/store-threat-actor.md +161 -0
  58. zettelforge-2.1.0/docs/index.md +130 -0
  59. zettelforge-2.1.0/docs/llms.txt +51 -0
  60. zettelforge-2.1.0/docs/reference/configuration.md +291 -0
  61. zettelforge-2.1.0/docs/reference/governance-controls.md +213 -0
  62. zettelforge-2.1.0/docs/reference/memory-manager-api.md +538 -0
  63. zettelforge-2.1.0/docs/reference/retrieval-policies.md +304 -0
  64. zettelforge-2.1.0/docs/reference/stix-schema.md +202 -0
  65. zettelforge-2.1.0/docs/rfcs/RFC-001-conversational-entity-extractor.md +113 -0
  66. zettelforge-2.1.0/docs/superpowers/plans/2026-04-09-ctibench-ragas-benchmarks.md +31 -0
  67. zettelforge-2.1.0/docs/superpowers/plans/2026-04-09-fastembed-local-embeddings.md +460 -0
  68. zettelforge-2.1.0/docs/superpowers/plans/2026-04-09-hybrid-typedb-lancedb-architecture.md +855 -0
  69. zettelforge-2.1.0/docs/superpowers/plans/2026-04-09-local-llm-llama-cpp.md +17 -0
  70. zettelforge-2.1.0/docs/tutorials/01-quickstart.md +220 -0
  71. zettelforge-2.1.0/docs/tutorials/02-first-cti-report.md +434 -0
  72. zettelforge-2.1.0/examples/athf_bridge.py +239 -0
  73. zettelforge-2.1.0/pyproject.toml +84 -0
  74. zettelforge-2.1.0/scripts/rebuild_index.py +122 -0
  75. zettelforge-2.1.0/scripts/typedb-setup.sh +36 -0
  76. zettelforge-2.1.0/scripts/zettelforge-rebuild.service +13 -0
  77. zettelforge-2.1.0/scripts/zettelforge-rebuild.timer +9 -0
  78. zettelforge-2.1.0/skills/claude-code-skill.md +110 -0
  79. zettelforge-2.1.0/skills/openclaw-skill.md +56 -0
  80. zettelforge-2.1.0/src/zettelforge/__init__.py +119 -0
  81. zettelforge-2.1.0/src/zettelforge/alias_resolver.py +112 -0
  82. zettelforge-2.1.0/src/zettelforge/blended_retriever.py +46 -0
  83. zettelforge-2.1.0/src/zettelforge/cache.py +85 -0
  84. zettelforge-2.1.0/src/zettelforge/config.py +317 -0
  85. zettelforge-2.1.0/src/zettelforge/edition.py +168 -0
  86. zettelforge-2.1.0/src/zettelforge/enterprise/__init__.py +17 -0
  87. zettelforge-2.1.0/src/zettelforge/entity_indexer.py +316 -0
  88. zettelforge-2.1.0/src/zettelforge/fact_extractor.py +94 -0
  89. zettelforge-2.1.0/src/zettelforge/governance_validator.py +65 -0
  90. zettelforge-2.1.0/src/zettelforge/graph_retriever.py +88 -0
  91. zettelforge-2.1.0/src/zettelforge/intent_classifier.py +200 -0
  92. zettelforge-2.1.0/src/zettelforge/knowledge_graph.py +401 -0
  93. zettelforge-2.1.0/src/zettelforge/llm_client.py +120 -0
  94. zettelforge-2.1.0/src/zettelforge/memory_manager.py +702 -0
  95. zettelforge-2.1.0/src/zettelforge/memory_store.py +246 -0
  96. zettelforge-2.1.0/src/zettelforge/memory_updater.py +125 -0
  97. zettelforge-2.1.0/src/zettelforge/note_constructor.py +237 -0
  98. zettelforge-2.1.0/src/zettelforge/note_schema.py +85 -0
  99. zettelforge-2.1.0/src/zettelforge/observability.py +83 -0
  100. zettelforge-2.1.0/src/zettelforge/ontology.py +471 -0
  101. zettelforge-2.1.0/src/zettelforge/retry.py +87 -0
  102. zettelforge-2.1.0/src/zettelforge/synthesis_generator.py +242 -0
  103. zettelforge-2.1.0/src/zettelforge/synthesis_validator.py +85 -0
  104. zettelforge-2.1.0/src/zettelforge/vector_memory.py +368 -0
  105. zettelforge-2.1.0/src/zettelforge/vector_retriever.py +331 -0
  106. zettelforge-2.1.0/tests/__init__.py +1 -0
  107. zettelforge-2.1.0/tests/benchmark_scale.py +139 -0
  108. zettelforge-2.1.0/tests/conftest.py +20 -0
  109. zettelforge-2.1.0/tests/test_basic.py +212 -0
  110. zettelforge-2.1.0/tests/test_blended_retriever.py +82 -0
  111. zettelforge-2.1.0/tests/test_causal_extraction.py +85 -0
  112. zettelforge-2.1.0/tests/test_config.py +145 -0
  113. zettelforge-2.1.0/tests/test_conversational_entities.py +168 -0
  114. zettelforge-2.1.0/tests/test_core.py +212 -0
  115. zettelforge-2.1.0/tests/test_cti_integration.py +74 -0
  116. zettelforge-2.1.0/tests/test_edition.py +135 -0
  117. zettelforge-2.1.0/tests/test_embedding.py +43 -0
  118. zettelforge-2.1.0/tests/test_fact_extractor.py +90 -0
  119. zettelforge-2.1.0/tests/test_governance.py +30 -0
  120. zettelforge-2.1.0/tests/test_graph_retriever.py +78 -0
  121. zettelforge-2.1.0/tests/test_intent_classifier.py +91 -0
  122. zettelforge-2.1.0/tests/test_llm_client.py +43 -0
  123. zettelforge-2.1.0/tests/test_memory_updater.py +179 -0
  124. zettelforge-2.1.0/tests/test_performance.py +91 -0
  125. zettelforge-2.1.0/tests/test_recall_integration.py +57 -0
  126. zettelforge-2.1.0/tests/test_temporal_graph.py +91 -0
  127. zettelforge-2.1.0/tests/test_two_phase_e2e.py +79 -0
  128. zettelforge-2.1.0/tests/test_typedb_client.py +146 -0
  129. zettelforge-2.1.0/web/app.py +406 -0
  130. zettelforge-2.1.0/web/auth.py +48 -0
  131. zettelforge-2.1.0/web/mcp_server.py +297 -0
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: Bug Report
3
+ about: Report a bug in ZettelForge
4
+ title: ''
5
+ labels: bug
6
+ assignees: ''
7
+ ---
8
+
9
+ **Describe the bug**
10
+ A clear description of what the bug is.
11
+
12
+ **To reproduce**
13
+ Steps to reproduce the behavior:
14
+ 1. ...
15
+ 2. ...
16
+
17
+ **Expected behavior**
18
+ What you expected to happen.
19
+
20
+ **Environment**
21
+ - ZettelForge version: (e.g., 2.1.0)
22
+ - Python version: (e.g., 3.11)
23
+ - OS: (e.g., Ubuntu 22.04)
24
+ - Backend: (jsonl / typedb)
25
+ - Edition: (community / enterprise)
26
+
27
+ **Logs / traceback**
28
+ ```
29
+ Paste any relevant error output here.
30
+ ```
@@ -0,0 +1,19 @@
1
+ ---
2
+ name: Feature Request
3
+ about: Suggest a feature for ZettelForge
4
+ title: ''
5
+ labels: enhancement
6
+ assignees: ''
7
+ ---
8
+
9
+ **Problem**
10
+ What problem does this feature solve?
11
+
12
+ **Proposed solution**
13
+ Describe the feature you'd like.
14
+
15
+ **Alternatives considered**
16
+ Any alternative approaches you've thought about.
17
+
18
+ **Edition**
19
+ Should this be a Community or Enterprise feature? (See [edition guide](../../src/zettelforge/edition.py) for the boundary.)
@@ -0,0 +1,33 @@
1
+ # Security Policy
2
+
3
+ ## Supported Versions
4
+
5
+ | Version | Supported |
6
+ |---------|--------------------|
7
+ | 2.1.x | Yes |
8
+ | < 2.0 | No |
9
+
10
+ ## Reporting a Vulnerability
11
+
12
+ If you discover a security vulnerability in ZettelForge, please report it
13
+ responsibly. **Do not open a public GitHub issue.**
14
+
15
+ Email **security@threatengram.com** with:
16
+
17
+ 1. Description of the vulnerability
18
+ 2. Steps to reproduce
19
+ 3. Potential impact
20
+ 4. Suggested fix (if any)
21
+
22
+ We will acknowledge your report within 48 hours and aim to provide a fix
23
+ within 7 days for critical issues.
24
+
25
+ ## Scope
26
+
27
+ This policy covers the ZettelForge open-source codebase. For vulnerabilities
28
+ in ThreatRecall Enterprise or hosted services, contact the same email.
29
+
30
+ ## Recognition
31
+
32
+ We appreciate security researchers who help keep ZettelForge safe. With your
33
+ permission, we will acknowledge your contribution in release notes.
@@ -0,0 +1,18 @@
1
+ ## Summary
2
+
3
+ Brief description of changes.
4
+
5
+ ## Related issue
6
+
7
+ Fixes #
8
+
9
+ ## Changes
10
+
11
+ - ...
12
+
13
+ ## Testing
14
+
15
+ - [ ] Tests pass (`pytest tests/ -v`)
16
+ - [ ] Linting passes (`ruff check src/zettelforge/`)
17
+ - [ ] New tests added for new functionality
18
+ - [ ] No enterprise features added to community code without discussion
@@ -0,0 +1,76 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ python-version: ['3.10', '3.11', '3.12']
15
+
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+
19
+ - name: Set up Python ${{ matrix.python-version }}
20
+ uses: actions/setup-python@v5
21
+ with:
22
+ python-version: ${{ matrix.python-version }}
23
+
24
+ - name: Install dependencies
25
+ run: |
26
+ python -m pip install --upgrade pip
27
+ pip install -e ".[dev]"
28
+
29
+ - name: Lint with ruff
30
+ run: |
31
+ ruff check src/zettelforge/
32
+
33
+ - name: Format check with black
34
+ run: |
35
+ black --check src/zettelforge/
36
+
37
+ - name: Type check with mypy
38
+ run: |
39
+ mypy src/zettelforge/ --ignore-missing-imports
40
+
41
+ - name: Test with pytest
42
+ env:
43
+ ZETTELFORGE_BACKEND: jsonl
44
+ run: |
45
+ pytest tests/ -v --ignore=tests/test_typedb_client.py --cov=zettelforge --cov-report=xml
46
+
47
+ - name: Upload coverage
48
+ uses: codecov/codecov-action@v3
49
+ with:
50
+ file: ./coverage.xml
51
+ fail_ci_if_error: false
52
+
53
+ build:
54
+ runs-on: ubuntu-latest
55
+ needs: test
56
+
57
+ steps:
58
+ - uses: actions/checkout@v4
59
+
60
+ - name: Set up Python
61
+ uses: actions/setup-python@v5
62
+ with:
63
+ python-version: '3.12'
64
+
65
+ - name: Install build dependencies
66
+ run: |
67
+ python -m pip install --upgrade pip
68
+ pip install build twine
69
+
70
+ - name: Build package
71
+ run: |
72
+ python -m build
73
+
74
+ - name: Check package
75
+ run: |
76
+ twine check dist/*
@@ -0,0 +1,28 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ permissions:
11
+ id-token: write # trusted publishing
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: '3.12'
20
+
21
+ - name: Install build dependencies
22
+ run: pip install build
23
+
24
+ - name: Build package
25
+ run: python -m build
26
+
27
+ - name: Publish to PyPI
28
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,67 @@
1
+ # ZettelForge config (may contain credentials)
2
+ config.yaml
3
+ config.yml
4
+ .env
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ .Python
12
+ build/
13
+ develop-eggs/
14
+ dist/
15
+ downloads/
16
+ eggs/
17
+ .eggs/
18
+ lib/
19
+ lib64/
20
+ parts/
21
+ sdist/
22
+ var/
23
+ wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+
28
+ # Virtual environments
29
+ venv/
30
+ ENV/
31
+ env/
32
+ .venv
33
+
34
+ # IDE
35
+ .vscode/
36
+ .idea/
37
+ *.swp
38
+ *.swo
39
+ *~
40
+
41
+ # Testing
42
+ .pytest_cache/
43
+ .coverage
44
+ htmlcov/
45
+ .tox/
46
+
47
+ # Runtime data (not source code)
48
+ /notes.jsonl
49
+ /kg_nodes.jsonl
50
+ /kg_edges.jsonl
51
+ /entity_index.json
52
+ *.lance/
53
+ vectordb/
54
+ .vector_memory.lance/
55
+ .snapshots/
56
+ archive/
57
+
58
+ # Data directories (runtime, not source)
59
+ /data/
60
+ /.amem/
61
+
62
+ # Logs
63
+ *.log
64
+
65
+ # OS
66
+ .DS_Store
67
+ Thumbs.db
@@ -0,0 +1,85 @@
1
+ # Changelog
2
+
3
+ All notable changes to ZettelForge are documented here.
4
+ Format based on [Keep a Changelog](https://keepachangelog.com/).
5
+
6
+ ## [2.1.0] - 2026-04-12
7
+
8
+ ### Added
9
+ - Open-core edition system (Community MIT + Enterprise BSL-1.1)
10
+ - Edition detection via `THREATENGRAM_LICENSE_KEY` or enterprise package
11
+ - `/api/edition` endpoint showing feature availability
12
+ - `EditionError` for clear upgrade messaging
13
+ - `LICENSE-ENTERPRISE` (BSL-1.1) for enterprise features
14
+ - GitHub issue/PR templates, SECURITY.md, CODE_OF_CONDUCT.md
15
+
16
+ ### Changed
17
+ - Dependencies split: core (MIT) vs `pip install zettelforge[enterprise]`
18
+ - Enterprise-only features: TypeDB STIX ontology, temporal KG queries,
19
+ advanced synthesis formats, report ingestion, multi-hop traversal,
20
+ OpenCTI integration, Sigma generation, multi-tenant auth
21
+ - Community gets full memory pipeline: blended retrieval, two-phase
22
+ extraction, intent routing, causal triples, cross-encoder reranking
23
+
24
+ ## [2.0.0] - 2026-04-09
25
+
26
+ ### Added
27
+ - Hybrid TypeDB + LanceDB architecture
28
+ - STIX 2.1 schema with 9 entity types, 8 relationship types
29
+ - TypeDB alias inference (36 CTI aliases: APT28/Fancy Bear/Strontium, etc.)
30
+ - Report ingestion with auto-chunking (`remember_report()`)
31
+ - In-process embeddings via fastembed (no Ollama needed for embeddings)
32
+ - Local LLM via llama-cpp-python (Qwen 2.5 3B)
33
+ - Conversational entity extraction (person, location, org, event, activity, temporal)
34
+ - Multi-tenant OAuth/JWT authentication
35
+ - ThreatRecall web UI (FastAPI)
36
+ - MCP server for Claude Code integration
37
+ - OpenCTI continuous sync
38
+ - MemoryAgentBench (ICLR 2026) benchmark
39
+ - Configuration system with layered resolution (env > yaml > defaults)
40
+ - Documentation suite (Diataxis framework)
41
+
42
+ ### Changed
43
+ - Knowledge graph backend: TypeDB-first with JSONL fallback
44
+ - Embedding provider: fastembed (in-process ONNX) replaces Ollama HTTP
45
+ - Bumped all benchmarks: CTI 75%, LOCOMO 18%, RAGAS 78.1%
46
+
47
+ ## [1.5.0] - 2026-04-08
48
+
49
+ ### Added
50
+ - GraphRetriever for multi-hop note discovery via knowledge graph
51
+ - BlendedRetriever combining vector + graph results with policy weights
52
+ - Rewritten `recall()` with blended vector + graph retrieval
53
+ - CTIBench (NeurIPS 2024) benchmark adapter
54
+ - RAGAS retrieval quality benchmark
55
+
56
+ ## [1.4.0] - 2026-04-07
57
+
58
+ ### Added
59
+ - FactExtractor (Phase 1): LLM-based salient fact extraction with importance scoring
60
+ - MemoryUpdater (Phase 2): ADD/UPDATE/DELETE/NOOP decision engine
61
+ - `remember_with_extraction()` two-phase pipeline
62
+
63
+ ## [1.3.0] - 2026-04-07
64
+
65
+ ### Added
66
+ - Sigma rule generation from IOCs
67
+ - Microsoft Sentinel rule conversion
68
+
69
+ ## [1.2.0] - 2026-04-07
70
+
71
+ ### Added
72
+ - CTI platform integration (Django CTI database connector)
73
+ - Proactive context injection for agent workflows
74
+
75
+ ## [1.0.0] - 2026-04-06
76
+
77
+ ### Added
78
+ - Core memory pipeline (remember, recall, vector search)
79
+ - Knowledge graph with JSONL persistence
80
+ - Entity extraction (CVE, actor, tool, campaign)
81
+ - Causal triple extraction (LLM-powered)
82
+ - Temporal graph indexing
83
+ - RAG synthesis (direct_answer format)
84
+ - Intent classification and query routing
85
+ - Cross-encoder reranking
@@ -0,0 +1,40 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment-free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio-economic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to a positive environment:
15
+
16
+ * Using welcoming and inclusive language
17
+ * Being respectful of differing viewpoints and experiences
18
+ * Gracefully accepting constructive criticism
19
+ * Focusing on what is best for the community
20
+ * Showing empathy towards other community members
21
+
22
+ Examples of unacceptable behavior:
23
+
24
+ * The use of sexualized language or imagery, and sexual attention or advances
25
+ * Trolling, insulting or derogatory comments, and personal or political attacks
26
+ * Public or private harassment
27
+ * Publishing others' private information without explicit permission
28
+ * Other conduct which could reasonably be considered inappropriate
29
+
30
+ ## Enforcement
31
+
32
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
33
+ reported to the project team at **community@threatengram.com**. All complaints
34
+ will be reviewed and investigated promptly and fairly.
35
+
36
+ ## Attribution
37
+
38
+ This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
39
+ version 2.1, available at
40
+ https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
@@ -0,0 +1,70 @@
1
+ # Contributing to ZettelForge
2
+
3
+ Thank you for your interest in contributing to ZettelForge! This document provides guidelines for contributing to the project.
4
+
5
+ ## Development Setup
6
+
7
+ 1. Fork and clone the repository
8
+ 2. Create a virtual environment: `python -m venv venv`
9
+ 3. Activate it: `source venv/bin/activate` (or `venv\Scripts\activate` on Windows)
10
+ 4. Install in development mode: `pip install -e ".[dev]"`
11
+ 5. Run tests to verify your setup: `ZETTELFORGE_BACKEND=jsonl pytest tests/ -v --ignore=tests/test_typedb_client.py`
12
+
13
+ No external services (Ollama, TypeDB) are required for development. Embeddings run in-process via fastembed, and the knowledge graph defaults to JSONL.
14
+
15
+ ## Development Workflow
16
+
17
+ 1. Create a feature branch: `git checkout -b feature/your-feature-name`
18
+ 2. Make your changes
19
+ 3. Run tests: `pytest tests/ -v`
20
+ 4. Run linting: `ruff check src/zettelforge/`
21
+ 5. Run formatting: `black src/zettelforge/`
22
+ 6. Commit with clear messages
23
+ 7. Push and create a pull request
24
+
25
+ ## Community vs Enterprise
26
+
27
+ ZettelForge uses an open-core model:
28
+
29
+ - **Community (MIT)** -- everything in `src/zettelforge/` except `enterprise/`. Contributions here are welcome and encouraged.
30
+ - **Enterprise (BSL-1.1)** -- code in `src/zettelforge/enterprise/` and features gated behind `is_enterprise()`. These are maintained by Threatengram.
31
+
32
+ If you're unsure whether a feature belongs in Community or Enterprise, open an issue to discuss before starting work.
33
+
34
+ ## Code Style
35
+
36
+ - Follow PEP 8
37
+ - Use type hints where possible
38
+ - Document functions with docstrings
39
+ - Keep functions focused and small
40
+ - Write tests for new functionality
41
+
42
+ ## Testing
43
+
44
+ - Write tests for new features
45
+ - Ensure all tests pass before submitting PR
46
+ - Tests that require Enterprise features should use the `enable_enterprise` fixture from `tests/conftest.py`
47
+ - Use meaningful test names that describe behavior
48
+
49
+ ## Commit Messages
50
+
51
+ Use clear, descriptive commit messages:
52
+
53
+ - `feat: Add entity extraction for CVE patterns`
54
+ - `fix: Correct vector similarity calculation`
55
+ - `docs: Update API reference`
56
+ - `test: Add tests for recall_cve method`
57
+
58
+ ## Pull Request Process
59
+
60
+ 1. Update documentation if needed
61
+ 2. Add tests for new functionality
62
+ 3. Ensure CI passes
63
+ 4. Request review from maintainers
64
+ 5. Address review feedback
65
+
66
+ ## Questions?
67
+
68
+ - Open an issue for bugs or feature requests
69
+ - Start a discussion for questions or ideas
70
+ - Check existing issues before creating new ones
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Patrick Roland
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.
@@ -0,0 +1,20 @@
1
+ Business Source License 1.1
2
+
3
+ Licensor: Threatengram, Inc.
4
+ Licensed Work: ThreatRecall Enterprise (zettelforge-enterprise package)
5
+ Change Date: Four years from each release date
6
+ Change License: Apache License, Version 2.0
7
+
8
+ The Licensed Work is provided under the terms of the Business Source
9
+ License 1.1 (BSL-1.1). See https://mariadb.com/bsl11/ for the full
10
+ license text.
11
+
12
+ Usage Grant: You may use the Licensed Work for any purpose, including
13
+ production use, provided that you do not offer the Licensed Work as a
14
+ commercial hosted service to third parties without a separate commercial
15
+ agreement with Threatengram, Inc.
16
+
17
+ All files in this repository (rolandpg/zettelforge) are MIT licensed.
18
+ The enterprise package (rolandpg/zettelforge-enterprise) is BSL-1.1.
19
+
20
+ Contact: enterprise@threatengram.com
@@ -0,0 +1,7 @@
1
+ include README.md
2
+ include LICENSE
3
+ include LICENSE-ENTERPRISE
4
+ include pyproject.toml
5
+ recursive-include src/zettelforge *.py
6
+ recursive-include tests *.py
7
+ recursive-include docs *.md
@@ -0,0 +1,174 @@
1
+ # ZettelForge Skill Package - Summary
2
+
3
+ ## What Was Created
4
+
5
+ A standalone, production-ready Python package for ZettelForge (Agentic Memory) that can be:
6
+ 1. Installed as a Python package via pip
7
+ 2. Used as an OpenClaw skill
8
+ 3. Published to GitHub as an open-source project
9
+ 4. Eventually published to PyPI
10
+
11
+ ## Directory Structure
12
+
13
+ ```
14
+ ~/.openclaw/workspace/skills/amem/
15
+ ├── .github/workflows/ci.yml # GitHub Actions CI/CD
16
+ ├── .git/ # Git repository
17
+ ├── .gitignore # Git ignore rules
18
+ ├── CONTRIBUTING.md # Contribution guidelines
19
+ ├── LICENSE # MIT License
20
+ ├── MANIFEST.in # Package manifest
21
+ ├── README.md # Project documentation
22
+ ├── SKILL.md # OpenClaw skill definition
23
+ ├── pyproject.toml # Python package config
24
+ ├── src/amem/ # Source code
25
+ │ ├── __init__.py # Package init
26
+ │ ├── entity_indexer.py # Entity extraction/indexing
27
+ │ ├── memory_manager.py # Main API
28
+ │ ├── memory_store.py # JSONL storage
29
+ │ ├── note_constructor.py # Note enrichment
30
+ │ ├── note_schema.py # Pydantic schemas
31
+ │ ├── vector_memory.py # LanceDB vector store
32
+ │ └── vector_retriever.py # Semantic search
33
+ └── tests/
34
+ └── test_basic.py # Unit tests
35
+ ```
36
+
37
+ ## Key Features Packaged
38
+
39
+ | Feature | Status | File |
40
+ |---------|--------|------|
41
+ | Core MemoryNote schema | ✅ | note_schema.py |
42
+ | JSONL storage | ✅ | memory_store.py |
43
+ | Vector storage (LanceDB) | ✅ | vector_memory.py |
44
+ | Semantic retrieval | ✅ | vector_retriever.py |
45
+ | Entity extraction | ✅ | entity_indexer.py |
46
+ | Entity-based lookup | ✅ | memory_manager.py |
47
+ | Main API (remember/recall) | ✅ | memory_manager.py |
48
+
49
+ ## Installation
50
+
51
+ ### Local Development
52
+
53
+ ```bash
54
+ cd ~/.openclaw/workspace/skills/amem
55
+ pip install -e ".[dev]"
56
+ ```
57
+
58
+ ### Usage
59
+
60
+ ```python
61
+ from amem import MemoryManager
62
+
63
+ mm = MemoryManager()
64
+
65
+ # Store memory
66
+ note, status = mm.remember("CVE-2024-3094 is a backdoor", domain="security_ops")
67
+
68
+ # Retrieve
69
+ results = mm.recall("XZ backdoor", k=5)
70
+
71
+ # Entity lookup
72
+ cve_notes = mm.recall_cve("CVE-2024-3094")
73
+ ```
74
+
75
+ ## Next Steps to Publish on GitHub
76
+
77
+ 1. **Create GitHub Repository:**
78
+ ```bash
79
+ # Option 1: Using GitHub CLI
80
+ gh repo create rolandpg/amem --public --source=. --remote=origin --push
81
+
82
+ # Option 2: Manual
83
+ # - Go to https://github.com/new
84
+ # - Create repo named "amem"
85
+ # - Follow push instructions
86
+ ```
87
+
88
+ 2. **Push to GitHub:**
89
+ ```bash
90
+ cd ~/.openclaw/workspace/skills/amem
91
+ git branch -m main
92
+ git remote add origin https://github.com/rolandpg/amem.git
93
+ git push -u origin main
94
+ ```
95
+
96
+ 3. **Set Up CI/CD:**
97
+ - GitHub Actions workflow already configured
98
+ - Will run tests on Python 3.10, 3.11, 3.12
99
+ - Runs linting, type checking, and tests
100
+
101
+ 4. **Future: Publish to PyPI:**
102
+ ```bash
103
+ # Build package
104
+ python -m build
105
+
106
+ # Upload to PyPI (requires account)
107
+ python -m twine upload dist/*
108
+ ```
109
+
110
+ ## Differences from Original ZettelForge
111
+
112
+ | Aspect | Original | Packaged |
113
+ |--------|----------|----------|
114
+ | Location | `~/.openclaw/workspace/memory/` | `~/.openclaw/workspace/skills/amem/` |
115
+ | Hardcoded paths | Yes | Environment configurable |
116
+ | Dependencies | Inline imports | Proper package deps in pyproject.toml |
117
+ | Tests | Phase-based (143 tests) | Simplified basic tests |
118
+ | Synthesis Layer | Phase 7 (complete) | Not included (can add later) |
119
+ | Knowledge Graph | Phase 6 (complete) | Not included (can add later) |
120
+ | Evolution | Multi-phase | Simplified |
121
+
122
+ ## What's NOT Included (Yet)
123
+
124
+ These advanced features from the original ZettelForge can be added in future versions:
125
+
126
+ 1. **Synthesis Layer (Phase 7)** - RAG-as-answer with LLM generation
127
+ 2. **Knowledge Graph (Phase 6)** - Full graph with IEP 2.0
128
+ 3. **Note Evolution** - Multi-phase note refinement
129
+ 4. **Link Generator** - Automatic note linking
130
+ 5. **Alias Resolution** - Entity name normalization
131
+ 6. **Cold Archive** - Automatic low-confidence archival
132
+ 7. **Burn-in Tests** - Comprehensive stress testing
133
+
134
+ ## Configuration
135
+
136
+ Environment variables for customization:
137
+
138
+ ```bash
139
+ export AMEM_DATA_DIR=/path/to/data # Default: ~/.amem
140
+ export AMEM_OLLAMA_URL=http://localhost:11434
141
+ export AMEM_EMBEDDING_MODEL=nomic-embed-text
142
+ ```
143
+
144
+ ## Version
145
+
146
+ Current: **1.0.0-alpha.1**
147
+
148
+ Following semantic versioning:
149
+ - Alpha: Early testing, API may change
150
+ - Beta: Feature complete, testing bugs
151
+ - 1.0.0: Production ready
152
+
153
+ ## Git Commit
154
+
155
+ Initial commit hash: `9da469e`
156
+
157
+ ```
158
+ Initial commit: ZettelForge Agentic Memory System v1.0.0-alpha.1
159
+ 17 files changed, 2001 insertions(+)
160
+ ```
161
+
162
+ ## Ready for Development
163
+
164
+ The package is ready for:
165
+ - ✅ Local installation and testing
166
+ - ✅ GitHub repository creation
167
+ - ✅ CI/CD pipeline
168
+ - ✅ OpenClaw skill usage
169
+ - 🔄 Future PyPI publication
170
+
171
+ ---
172
+
173
+ Created: 2026-04-05
174
+ Location: ~/.openclaw/workspace/skills/amem/