omni-cortex 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. omni_cortex-1.0.1/.gitignore +157 -0
  2. omni_cortex-1.0.1/LICENSE +21 -0
  3. omni_cortex-1.0.1/PKG-INFO +216 -0
  4. omni_cortex-1.0.1/README.md +179 -0
  5. omni_cortex-1.0.1/hooks/post_tool_use.py +154 -0
  6. omni_cortex-1.0.1/hooks/pre_tool_use.py +144 -0
  7. omni_cortex-1.0.1/hooks/stop.py +184 -0
  8. omni_cortex-1.0.1/hooks/subagent_stop.py +120 -0
  9. omni_cortex-1.0.1/omni_cortex/__init__.py +3 -0
  10. omni_cortex-1.0.1/omni_cortex/categorization/__init__.py +9 -0
  11. omni_cortex-1.0.1/omni_cortex/categorization/auto_tags.py +166 -0
  12. omni_cortex-1.0.1/omni_cortex/categorization/auto_type.py +165 -0
  13. omni_cortex-1.0.1/omni_cortex/config.py +141 -0
  14. omni_cortex-1.0.1/omni_cortex/database/__init__.py +12 -0
  15. omni_cortex-1.0.1/omni_cortex/database/connection.py +137 -0
  16. omni_cortex-1.0.1/omni_cortex/database/migrations.py +78 -0
  17. omni_cortex-1.0.1/omni_cortex/database/schema.py +204 -0
  18. omni_cortex-1.0.1/omni_cortex/decay/__init__.py +7 -0
  19. omni_cortex-1.0.1/omni_cortex/decay/importance.py +147 -0
  20. omni_cortex-1.0.1/omni_cortex/embeddings/__init__.py +35 -0
  21. omni_cortex-1.0.1/omni_cortex/embeddings/local.py +362 -0
  22. omni_cortex-1.0.1/omni_cortex/models/__init__.py +20 -0
  23. omni_cortex-1.0.1/omni_cortex/models/activity.py +237 -0
  24. omni_cortex-1.0.1/omni_cortex/models/agent.py +144 -0
  25. omni_cortex-1.0.1/omni_cortex/models/memory.py +395 -0
  26. omni_cortex-1.0.1/omni_cortex/models/relationship.py +206 -0
  27. omni_cortex-1.0.1/omni_cortex/models/session.py +290 -0
  28. omni_cortex-1.0.1/omni_cortex/resources/__init__.py +1 -0
  29. omni_cortex-1.0.1/omni_cortex/search/__init__.py +22 -0
  30. omni_cortex-1.0.1/omni_cortex/search/hybrid.py +197 -0
  31. omni_cortex-1.0.1/omni_cortex/search/keyword.py +204 -0
  32. omni_cortex-1.0.1/omni_cortex/search/ranking.py +127 -0
  33. omni_cortex-1.0.1/omni_cortex/search/semantic.py +225 -0
  34. omni_cortex-1.0.1/omni_cortex/server.py +151 -0
  35. omni_cortex-1.0.1/omni_cortex/setup.py +278 -0
  36. omni_cortex-1.0.1/omni_cortex/tools/__init__.py +13 -0
  37. omni_cortex-1.0.1/omni_cortex/tools/activities.py +232 -0
  38. omni_cortex-1.0.1/omni_cortex/tools/memories.py +466 -0
  39. omni_cortex-1.0.1/omni_cortex/tools/sessions.py +311 -0
  40. omni_cortex-1.0.1/omni_cortex/tools/utilities.py +287 -0
  41. omni_cortex-1.0.1/omni_cortex/utils/__init__.py +13 -0
  42. omni_cortex-1.0.1/omni_cortex/utils/formatting.py +223 -0
  43. omni_cortex-1.0.1/omni_cortex/utils/ids.py +72 -0
  44. omni_cortex-1.0.1/omni_cortex/utils/timestamps.py +129 -0
  45. omni_cortex-1.0.1/omni_cortex/utils/truncation.py +111 -0
  46. omni_cortex-1.0.1/pyproject.toml +85 -0
  47. omni_cortex-1.0.1/scripts/setup.py +208 -0
@@ -0,0 +1,157 @@
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
+ .Python
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
+ *.manifest
31
+ *.spec
32
+
33
+ # Installer logs
34
+ pip-log.txt
35
+ pip-delete-this-directory.txt
36
+
37
+ # Unit test / coverage reports
38
+ htmlcov/
39
+ .tox/
40
+ .nox/
41
+ .coverage
42
+ .coverage.*
43
+ .cache
44
+ nosetests.xml
45
+ coverage.xml
46
+ *.cover
47
+ *.py,cover
48
+ .hypothesis/
49
+ .pytest_cache/
50
+
51
+ # Translations
52
+ *.mo
53
+ *.pot
54
+
55
+ # Django stuff:
56
+ *.log
57
+ local_settings.py
58
+ db.sqlite3
59
+ db.sqlite3-journal
60
+
61
+ # Flask stuff:
62
+ instance/
63
+ .webassets-cache
64
+
65
+ # Scrapy stuff:
66
+ .scrapy
67
+
68
+ # Sphinx documentation
69
+ docs/_build/
70
+
71
+ # PyBuilder
72
+ .pybuilder/
73
+ target/
74
+
75
+ # Jupyter Notebook
76
+ .ipynb_checkpoints
77
+
78
+ # IPython
79
+ profile_default/
80
+ ipython_config.py
81
+
82
+ # pyenv
83
+ .python-version
84
+
85
+ # pipenv
86
+ Pipfile.lock
87
+
88
+ # PEP 582
89
+ __pypackages__/
90
+
91
+ # Celery stuff
92
+ celerybeat-schedule
93
+ celerybeat.pid
94
+
95
+ # SageMath parsed files
96
+ *.sage.py
97
+
98
+ # Environments
99
+ .env
100
+ .venv
101
+ env/
102
+ venv/
103
+ ENV/
104
+ env.bak/
105
+ venv.bak/
106
+
107
+ # Spyder project settings
108
+ .spyderproject
109
+ .spyproject
110
+
111
+ # Rope project settings
112
+ .ropeproject
113
+
114
+ # mkdocs documentation
115
+ /site
116
+
117
+ # mypy
118
+ .mypy_cache/
119
+ .dmypy.json
120
+ dmypy.json
121
+
122
+ # Pyre type checker
123
+ .pyre/
124
+
125
+ # pytype static type analyzer
126
+ .pytype/
127
+
128
+ # Cython debug symbols
129
+ cython_debug/
130
+
131
+ # IDE
132
+ .vscode/
133
+ .idea/
134
+ *.swp
135
+ *.swo
136
+ *~
137
+
138
+ # Project specific
139
+ .omni-cortex/
140
+ *.db
141
+ *.db-journal
142
+ *.db-wal
143
+ *.db-shm
144
+
145
+ # OS
146
+ .DS_Store
147
+ Thumbs.db
148
+
149
+ # Test files
150
+ test_*.py
151
+ !tests/test_*.py
152
+
153
+ # Development files
154
+ PROMPT.md
155
+ memories.json
156
+ .claude/
157
+ .mcp.json
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Tony Simonovsky
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,216 @@
1
+ Metadata-Version: 2.4
2
+ Name: omni-cortex
3
+ Version: 1.0.1
4
+ Summary: Universal Memory MCP for Claude Code - dual-layer activity logging and knowledge storage
5
+ Project-URL: Homepage, https://github.com/AllCytes/Omni-Cortex
6
+ Project-URL: Repository, https://github.com/AllCytes/Omni-Cortex
7
+ Project-URL: Issues, https://github.com/AllCytes/Omni-Cortex/issues
8
+ Project-URL: Documentation, https://github.com/AllCytes/Omni-Cortex#readme
9
+ Author: Tony
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: ai,anthropic,claude,claude-code,llm,mcp,memory,semantic-search
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: httpx>=0.25.0
25
+ Requires-Dist: mcp>=1.0.0
26
+ Requires-Dist: pydantic>=2.0.0
27
+ Requires-Dist: pyyaml>=6.0.0
28
+ Provides-Extra: dev
29
+ Requires-Dist: black>=23.0.0; extra == 'dev'
30
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
31
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
32
+ Requires-Dist: ruff>=0.1.0; extra == 'dev'
33
+ Provides-Extra: semantic
34
+ Requires-Dist: numpy>=1.24.0; extra == 'semantic'
35
+ Requires-Dist: sentence-transformers>=2.2.0; extra == 'semantic'
36
+ Description-Content-Type: text/markdown
37
+
38
+ # Omni Cortex MCP
39
+
40
+ A universal memory system for Claude Code that combines activity logging with intelligent knowledge storage.
41
+
42
+ ## Features
43
+
44
+ - **Zero Configuration**: Works out of the box - just install and run setup
45
+ - **Dual-Layer Storage**: Activity logging (audit trail) + Knowledge store (memories)
46
+ - **15 MCP Tools**: Full-featured API for memory management, activity tracking, and session continuity
47
+ - **Semantic Search**: AI-powered search using sentence-transformers (optional)
48
+ - **Hybrid Search**: Combines keyword (FTS5) + semantic search for best results
49
+ - **Full-Text Search**: SQLite FTS5-powered keyword search with smart ranking
50
+ - **Auto-Categorization**: Automatic memory type detection and tag suggestions
51
+ - **Session Continuity**: "Last time you were working on..." context
52
+ - **Importance Decay**: Frequently accessed memories naturally surface
53
+ - **Auto Activity Logging**: Automatically logs all tool calls via hooks
54
+
55
+ ## Installation
56
+
57
+ ### Quick Install (Recommended)
58
+
59
+ ```bash
60
+ # Install the package
61
+ pip install omni-cortex
62
+
63
+ # Run automatic setup (configures MCP server + hooks)
64
+ omni-cortex-setup
65
+ ```
66
+
67
+ That's it! Omni Cortex will now:
68
+ - Automatically log all Claude Code tool calls
69
+ - Provide memory tools (cortex_remember, cortex_recall, etc.)
70
+ - Create a per-project database at `.omni-cortex/cortex.db`
71
+
72
+ ### With Semantic Search
73
+
74
+ For AI-powered semantic search capabilities:
75
+
76
+ ```bash
77
+ pip install omni-cortex[semantic]
78
+ omni-cortex-setup
79
+ ```
80
+
81
+ ### From Source
82
+
83
+ ```bash
84
+ git clone https://github.com/AllCytes/Omni-Cortex.git
85
+ cd omni-cortex
86
+ pip install -e ".[semantic]"
87
+ python -m omni_cortex.setup
88
+ ```
89
+
90
+ ### Manual Configuration
91
+
92
+ If you prefer manual setup, add to `~/.claude.json`:
93
+
94
+ ```json
95
+ {
96
+ "mcpServers": {
97
+ "omni-cortex": {
98
+ "command": "python",
99
+ "args": ["-m", "omni_cortex.server"]
100
+ }
101
+ }
102
+ }
103
+ ```
104
+
105
+ And optionally configure hooks in `~/.claude/settings.json` for activity logging:
106
+
107
+ ```json
108
+ {
109
+ "hooks": {
110
+ "PreToolUse": [{
111
+ "type": "command",
112
+ "command": "python -m omni_cortex.hooks.pre_tool_use"
113
+ }],
114
+ "PostToolUse": [{
115
+ "type": "command",
116
+ "command": "python -m omni_cortex.hooks.post_tool_use"
117
+ }]
118
+ }
119
+ }
120
+ ```
121
+
122
+ ### Uninstall
123
+
124
+ ```bash
125
+ omni-cortex-setup --uninstall
126
+ pip uninstall omni-cortex
127
+ ```
128
+
129
+ ## Tools
130
+
131
+ ### Memory Tools (6)
132
+
133
+ | Tool | Description |
134
+ |------|-------------|
135
+ | `cortex_remember` | Store information with auto-categorization |
136
+ | `cortex_recall` | Search memories (modes: keyword, semantic, hybrid) |
137
+ | `cortex_list_memories` | List memories with filters and pagination |
138
+ | `cortex_update_memory` | Update memory content, tags, or status |
139
+ | `cortex_forget` | Delete a memory |
140
+ | `cortex_link_memories` | Create relationships between memories |
141
+
142
+ ### Activity Tools (3)
143
+
144
+ | Tool | Description |
145
+ |------|-------------|
146
+ | `cortex_log_activity` | Manually log an activity |
147
+ | `cortex_get_activities` | Query the activity log |
148
+ | `cortex_get_timeline` | Get a chronological timeline |
149
+
150
+ ### Session Tools (3)
151
+
152
+ | Tool | Description |
153
+ |------|-------------|
154
+ | `cortex_start_session` | Start a new session with context |
155
+ | `cortex_end_session` | End session and generate summary |
156
+ | `cortex_get_session_context` | Get context from previous sessions |
157
+
158
+ ### Utility Tools (3)
159
+
160
+ | Tool | Description |
161
+ |------|-------------|
162
+ | `cortex_list_tags` | List all tags with usage counts |
163
+ | `cortex_review_memories` | Review and update memory freshness |
164
+ | `cortex_export` | Export data to markdown or JSON |
165
+
166
+ ## Memory Types
167
+
168
+ Memories are automatically categorized into:
169
+
170
+ - `general` - General notes and information
171
+ - `warning` - Cautions, things to avoid
172
+ - `tip` - Tips, tricks, best practices
173
+ - `config` - Configuration and settings
174
+ - `troubleshooting` - Debugging and problem-solving
175
+ - `code` - Code snippets and algorithms
176
+ - `error` - Error messages and failures
177
+ - `solution` - Solutions to problems
178
+ - `command` - CLI commands
179
+ - `concept` - Definitions and explanations
180
+ - `decision` - Architectural decisions
181
+
182
+ ## Storage
183
+
184
+ - **Per-project**: `.omni-cortex/cortex.db` in your project directory
185
+ - **Global**: `~/.omni-cortex/global.db` for cross-project search
186
+
187
+ ## Configuration
188
+
189
+ Create `.omni-cortex/config.yaml` in your project:
190
+
191
+ ```yaml
192
+ schema_version: "1.0"
193
+ embedding_enabled: true
194
+ decay_rate_per_day: 0.5
195
+ freshness_review_days: 30
196
+ auto_provide_context: true
197
+ context_depth: 3
198
+ ```
199
+
200
+ ## Development
201
+
202
+ ```bash
203
+ # Install dev dependencies
204
+ pip install -e ".[dev]"
205
+
206
+ # Run tests
207
+ pytest
208
+
209
+ # Format code
210
+ black src tests
211
+ ruff check src tests
212
+ ```
213
+
214
+ ## License
215
+
216
+ MIT
@@ -0,0 +1,179 @@
1
+ # Omni Cortex MCP
2
+
3
+ A universal memory system for Claude Code that combines activity logging with intelligent knowledge storage.
4
+
5
+ ## Features
6
+
7
+ - **Zero Configuration**: Works out of the box - just install and run setup
8
+ - **Dual-Layer Storage**: Activity logging (audit trail) + Knowledge store (memories)
9
+ - **15 MCP Tools**: Full-featured API for memory management, activity tracking, and session continuity
10
+ - **Semantic Search**: AI-powered search using sentence-transformers (optional)
11
+ - **Hybrid Search**: Combines keyword (FTS5) + semantic search for best results
12
+ - **Full-Text Search**: SQLite FTS5-powered keyword search with smart ranking
13
+ - **Auto-Categorization**: Automatic memory type detection and tag suggestions
14
+ - **Session Continuity**: "Last time you were working on..." context
15
+ - **Importance Decay**: Frequently accessed memories naturally surface
16
+ - **Auto Activity Logging**: Automatically logs all tool calls via hooks
17
+
18
+ ## Installation
19
+
20
+ ### Quick Install (Recommended)
21
+
22
+ ```bash
23
+ # Install the package
24
+ pip install omni-cortex
25
+
26
+ # Run automatic setup (configures MCP server + hooks)
27
+ omni-cortex-setup
28
+ ```
29
+
30
+ That's it! Omni Cortex will now:
31
+ - Automatically log all Claude Code tool calls
32
+ - Provide memory tools (cortex_remember, cortex_recall, etc.)
33
+ - Create a per-project database at `.omni-cortex/cortex.db`
34
+
35
+ ### With Semantic Search
36
+
37
+ For AI-powered semantic search capabilities:
38
+
39
+ ```bash
40
+ pip install omni-cortex[semantic]
41
+ omni-cortex-setup
42
+ ```
43
+
44
+ ### From Source
45
+
46
+ ```bash
47
+ git clone https://github.com/AllCytes/Omni-Cortex.git
48
+ cd omni-cortex
49
+ pip install -e ".[semantic]"
50
+ python -m omni_cortex.setup
51
+ ```
52
+
53
+ ### Manual Configuration
54
+
55
+ If you prefer manual setup, add to `~/.claude.json`:
56
+
57
+ ```json
58
+ {
59
+ "mcpServers": {
60
+ "omni-cortex": {
61
+ "command": "python",
62
+ "args": ["-m", "omni_cortex.server"]
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ And optionally configure hooks in `~/.claude/settings.json` for activity logging:
69
+
70
+ ```json
71
+ {
72
+ "hooks": {
73
+ "PreToolUse": [{
74
+ "type": "command",
75
+ "command": "python -m omni_cortex.hooks.pre_tool_use"
76
+ }],
77
+ "PostToolUse": [{
78
+ "type": "command",
79
+ "command": "python -m omni_cortex.hooks.post_tool_use"
80
+ }]
81
+ }
82
+ }
83
+ ```
84
+
85
+ ### Uninstall
86
+
87
+ ```bash
88
+ omni-cortex-setup --uninstall
89
+ pip uninstall omni-cortex
90
+ ```
91
+
92
+ ## Tools
93
+
94
+ ### Memory Tools (6)
95
+
96
+ | Tool | Description |
97
+ |------|-------------|
98
+ | `cortex_remember` | Store information with auto-categorization |
99
+ | `cortex_recall` | Search memories (modes: keyword, semantic, hybrid) |
100
+ | `cortex_list_memories` | List memories with filters and pagination |
101
+ | `cortex_update_memory` | Update memory content, tags, or status |
102
+ | `cortex_forget` | Delete a memory |
103
+ | `cortex_link_memories` | Create relationships between memories |
104
+
105
+ ### Activity Tools (3)
106
+
107
+ | Tool | Description |
108
+ |------|-------------|
109
+ | `cortex_log_activity` | Manually log an activity |
110
+ | `cortex_get_activities` | Query the activity log |
111
+ | `cortex_get_timeline` | Get a chronological timeline |
112
+
113
+ ### Session Tools (3)
114
+
115
+ | Tool | Description |
116
+ |------|-------------|
117
+ | `cortex_start_session` | Start a new session with context |
118
+ | `cortex_end_session` | End session and generate summary |
119
+ | `cortex_get_session_context` | Get context from previous sessions |
120
+
121
+ ### Utility Tools (3)
122
+
123
+ | Tool | Description |
124
+ |------|-------------|
125
+ | `cortex_list_tags` | List all tags with usage counts |
126
+ | `cortex_review_memories` | Review and update memory freshness |
127
+ | `cortex_export` | Export data to markdown or JSON |
128
+
129
+ ## Memory Types
130
+
131
+ Memories are automatically categorized into:
132
+
133
+ - `general` - General notes and information
134
+ - `warning` - Cautions, things to avoid
135
+ - `tip` - Tips, tricks, best practices
136
+ - `config` - Configuration and settings
137
+ - `troubleshooting` - Debugging and problem-solving
138
+ - `code` - Code snippets and algorithms
139
+ - `error` - Error messages and failures
140
+ - `solution` - Solutions to problems
141
+ - `command` - CLI commands
142
+ - `concept` - Definitions and explanations
143
+ - `decision` - Architectural decisions
144
+
145
+ ## Storage
146
+
147
+ - **Per-project**: `.omni-cortex/cortex.db` in your project directory
148
+ - **Global**: `~/.omni-cortex/global.db` for cross-project search
149
+
150
+ ## Configuration
151
+
152
+ Create `.omni-cortex/config.yaml` in your project:
153
+
154
+ ```yaml
155
+ schema_version: "1.0"
156
+ embedding_enabled: true
157
+ decay_rate_per_day: 0.5
158
+ freshness_review_days: 30
159
+ auto_provide_context: true
160
+ context_depth: 3
161
+ ```
162
+
163
+ ## Development
164
+
165
+ ```bash
166
+ # Install dev dependencies
167
+ pip install -e ".[dev]"
168
+
169
+ # Run tests
170
+ pytest
171
+
172
+ # Format code
173
+ black src tests
174
+ ruff check src tests
175
+ ```
176
+
177
+ ## License
178
+
179
+ MIT