omni-cortex 1.12.0__tar.gz → 1.12.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.
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/PKG-INFO +1 -1
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/chat_service.py +57 -3
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/database.py +1430 -1094
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/main.py +1592 -1381
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/models.py +370 -285
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/__init__.py +1 -1
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/pyproject.toml +1 -1
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/.gitignore +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/LICENSE +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/README.md +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/.env.example +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/backfill_summaries.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/image_service.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/logging_config.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/project_config.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/project_scanner.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/prompt_security.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/pyproject.toml +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/security.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/uv.lock +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/dashboard/backend/websocket_manager.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/hooks/post_tool_use.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/hooks/pre_tool_use.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/hooks/session_utils.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/hooks/stop.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/hooks/subagent_stop.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/hooks/user_prompt.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/categorization/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/categorization/auto_tags.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/categorization/auto_type.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/config.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/dashboard.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/database/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/database/connection.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/database/migrations.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/database/schema.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/database/sync.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/decay/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/decay/importance.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/embeddings/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/embeddings/local.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/models/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/models/activity.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/models/agent.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/models/memory.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/models/relationship.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/models/session.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/resources/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/search/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/search/hybrid.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/search/keyword.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/search/ranking.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/search/semantic.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/server.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/setup.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/tools/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/tools/activities.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/tools/memories.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/tools/sessions.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/tools/utilities.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/utils/__init__.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/utils/formatting.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/utils/ids.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/utils/timestamps.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/omni_cortex/utils/truncation.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/scripts/check-venv.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/scripts/import_ken_memories.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/scripts/populate_session_data.py +0 -0
- {omni_cortex-1.12.0 → omni_cortex-1.12.1}/scripts/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: omni-cortex
|
|
3
|
-
Version: 1.12.
|
|
3
|
+
Version: 1.12.1
|
|
4
4
|
Summary: Give Claude Code a perfect memory - auto-logs everything, searches smartly, and gets smarter over time
|
|
5
5
|
Project-URL: Homepage, https://github.com/AllCytes/Omni-Cortex
|
|
6
6
|
Project-URL: Repository, https://github.com/AllCytes/Omni-Cortex
|
|
@@ -42,7 +42,38 @@ def is_available() -> bool:
|
|
|
42
42
|
return False
|
|
43
43
|
|
|
44
44
|
|
|
45
|
-
def
|
|
45
|
+
def build_style_context_prompt(style_profile: dict) -> str:
|
|
46
|
+
"""Build a prompt section describing user's communication style."""
|
|
47
|
+
|
|
48
|
+
tone_dist = style_profile.get("tone_distribution", {})
|
|
49
|
+
tone_list = ", ".join(tone_dist.keys()) if tone_dist else "neutral"
|
|
50
|
+
avg_words = style_profile.get("avg_word_count", 20)
|
|
51
|
+
question_freq = style_profile.get("question_frequency", 0)
|
|
52
|
+
|
|
53
|
+
markers = style_profile.get("key_markers", [])
|
|
54
|
+
markers_text = "\n".join(f"- {m}" for m in markers) if markers else "- Direct and clear"
|
|
55
|
+
|
|
56
|
+
return f"""
|
|
57
|
+
## User Communication Style Profile
|
|
58
|
+
|
|
59
|
+
When the user requests content "in their style" or "like they write", follow these patterns:
|
|
60
|
+
|
|
61
|
+
**Typical Message Length:** ~{int(avg_words)} words
|
|
62
|
+
**Common Tones:** {tone_list}
|
|
63
|
+
**Question Frequency:** {int(question_freq * 100)}% of messages include questions
|
|
64
|
+
|
|
65
|
+
**Key Style Markers:**
|
|
66
|
+
{markers_text}
|
|
67
|
+
|
|
68
|
+
**Guidelines:**
|
|
69
|
+
- Match the user's typical message length and structure
|
|
70
|
+
- Use their common vocabulary patterns
|
|
71
|
+
- Mirror their tone and formality level
|
|
72
|
+
- If they're typically direct, be concise; if detailed, be comprehensive
|
|
73
|
+
"""
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
def _build_prompt(question: str, context_str: str, style_context: Optional[str] = None) -> str:
|
|
46
77
|
"""Build the prompt for the AI model with injection protection."""
|
|
47
78
|
system_instruction = """You are a helpful assistant that answers questions about stored memories and knowledge.
|
|
48
79
|
|
|
@@ -59,6 +90,10 @@ Instructions:
|
|
|
59
90
|
|
|
60
91
|
Answer:"""
|
|
61
92
|
|
|
93
|
+
# Add style context if provided
|
|
94
|
+
if style_context:
|
|
95
|
+
system_instruction = f"{system_instruction}\n\n{style_context}"
|
|
96
|
+
|
|
62
97
|
return build_safe_prompt(
|
|
63
98
|
system_instruction=system_instruction,
|
|
64
99
|
user_data={"memories": context_str},
|
|
@@ -112,9 +147,16 @@ async def stream_ask_about_memories(
|
|
|
112
147
|
db_path: str,
|
|
113
148
|
question: str,
|
|
114
149
|
max_memories: int = 10,
|
|
150
|
+
style_context: Optional[dict] = None,
|
|
115
151
|
) -> AsyncGenerator[dict[str, Any], None]:
|
|
116
152
|
"""Stream a response to a question about memories.
|
|
117
153
|
|
|
154
|
+
Args:
|
|
155
|
+
db_path: Path to the database file
|
|
156
|
+
question: The user's question
|
|
157
|
+
max_memories: Maximum memories to include in context
|
|
158
|
+
style_context: Optional user style profile dictionary
|
|
159
|
+
|
|
118
160
|
Yields events with type 'sources', 'chunk', 'done', or 'error'.
|
|
119
161
|
"""
|
|
120
162
|
if not is_available():
|
|
@@ -155,8 +197,13 @@ async def stream_ask_about_memories(
|
|
|
155
197
|
"data": sources,
|
|
156
198
|
}
|
|
157
199
|
|
|
200
|
+
# Build style context prompt if provided
|
|
201
|
+
style_prompt = None
|
|
202
|
+
if style_context:
|
|
203
|
+
style_prompt = build_style_context_prompt(style_context)
|
|
204
|
+
|
|
158
205
|
# Build and stream the response
|
|
159
|
-
prompt = _build_prompt(question, context_str)
|
|
206
|
+
prompt = _build_prompt(question, context_str, style_prompt)
|
|
160
207
|
|
|
161
208
|
try:
|
|
162
209
|
# Use streaming with the new google.genai client
|
|
@@ -260,6 +307,7 @@ async def ask_about_memories(
|
|
|
260
307
|
db_path: str,
|
|
261
308
|
question: str,
|
|
262
309
|
max_memories: int = 10,
|
|
310
|
+
style_context: Optional[dict] = None,
|
|
263
311
|
) -> dict:
|
|
264
312
|
"""Ask a natural language question about memories (non-streaming).
|
|
265
313
|
|
|
@@ -267,6 +315,7 @@ async def ask_about_memories(
|
|
|
267
315
|
db_path: Path to the database file
|
|
268
316
|
question: The user's question
|
|
269
317
|
max_memories: Maximum memories to include in context
|
|
318
|
+
style_context: Optional user style profile dictionary
|
|
270
319
|
|
|
271
320
|
Returns:
|
|
272
321
|
Dict with answer and sources
|
|
@@ -295,7 +344,12 @@ async def ask_about_memories(
|
|
|
295
344
|
"error": None,
|
|
296
345
|
}
|
|
297
346
|
|
|
298
|
-
prompt
|
|
347
|
+
# Build style context prompt if provided
|
|
348
|
+
style_prompt = None
|
|
349
|
+
if style_context:
|
|
350
|
+
style_prompt = build_style_context_prompt(style_context)
|
|
351
|
+
|
|
352
|
+
prompt = _build_prompt(question, context_str, style_prompt)
|
|
299
353
|
|
|
300
354
|
try:
|
|
301
355
|
response = client.models.generate_content(
|