Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,24 @@ jobs:
# pycparser 3.0, sse-starlette 3.3.2 — MIT per classifiers, scancode misdetects
# LGPL-*: @img/sharp-libvips-* (Astro image optimization, build-time only)
# BlueOak-1.0.0: lru-cache, sax (Astro transitive deps, permissive)
# LicenseRef-scancode-protobuf: protobuf 5.29.6 (BSD-3-Clause AND scancode-protobuf, permissive)
# ZPL-2.1: pytz 2026.1 (MIT AND ZPL-2.1, Zope Public License — permissive)
# Null: mem0ai, numpy, qdrant-client, posthog — license metadata missing
# from lockfile but all are permissive (Apache-2.0 / BSD-3-Clause / MIT)
allow-licenses: >-
MIT, MIT-0, Apache-2.0, BSD-2-Clause, BSD-3-Clause,
ISC, MPL-2.0, PSF-2.0, Unlicense, 0BSD,
CC0-1.0, Python-2.0, Python-2.0.1,
LicenseRef-scancode-free-unknown,
LicenseRef-scancode-free-unknown, LicenseRef-scancode-protobuf,
ZPL-2.1,
LGPL-2.0-only, LGPL-2.1-only, LGPL-3.0-only, LGPL-3.0-or-later,
BlueOak-1.0.0
# Packages with null/missing SPDX license metadata in lockfile.
# Verified manually: mem0ai (Apache-2.0), numpy (BSD-3-Clause),
# qdrant-client (Apache-2.0), posthog (MIT).
allow-dependencies-licenses: >-
pkg:pypi/mem0ai@1.0.5,
pkg:pypi/numpy@2.4.3,
pkg:pypi/qdrant-client@1.17.0,
pkg:pypi/posthog@7.9.12
comment-summary-in-pr: always
3 changes: 2 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ src/ai_company/
core/ # Shared domain models, base classes, and resilience config (RetryConfig, RateLimiterConfig)
engine/ # Agent orchestration, execution loops, parallel execution, task decomposition, routing, task assignment, centralized single-writer task state engine (TaskEngine), task lifecycle, recovery, shutdown, workspace isolation, coordination error classification, prompt policy validation, and AgentEngine-TaskEngine incremental status sync
hr/ # HR engine: hiring, firing, onboarding, offboarding, agent registry, performance tracking (task metrics, collaboration scoring, trend detection), promotion/demotion (criteria evaluation, approval strategies, model mapping)
memory/ # Persistent agent memory (Mem0 initial, custom stack future — see Decision Log), retrieval pipeline (ranking, injection, context formatting, non-inferable filtering), shared org memory (org/), consolidation/archival (consolidation/)
memory/ # Persistent agent memory (pluggable MemoryBackend protocol), backends/ (Mem0 adapter: backends/mem0/), retrieval pipeline (ranking, injection, context formatting, non-inferable filtering), shared org memory (org/), consolidation/archival (consolidation/)
persistence/ # Operational data persistence — pluggable PersistenceBackend protocol, SQLite initial (see Memory & Persistence design page)
observability/ # Structured logging, correlation tracking, log sinks
providers/ # LLM provider abstraction (LiteLLM adapter)
Expand Down Expand Up @@ -205,4 +205,5 @@ src/ai_company/

- **Pinned**: all versions use `==` in `pyproject.toml`
- **Groups**: `test` (pytest + plugins), `dev` (includes test + ruff, mypy, pre-commit, commitizen)
- **Required**: `mem0ai` (Mem0 memory backend — the default and currently only backend)
- **Install**: `uv sync` installs everything (dev group is default)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ graph TB

## Status

Core framework complete — agent engine, multi-agent coordination, API, security, HR, memory, and budget systems are implemented. Remaining: Mem0 adapter backend, approval workflow gates, CLI, web dashboard. See the [roadmap](docs/roadmap/index.md) for details.
Core framework complete — agent engine, multi-agent coordination, API, security, HR, memory (including Mem0 backend adapter), and budget systems are implemented. Remaining: approval workflow gates, CLI, web dashboard. See the [roadmap](docs/roadmap/index.md) for details.

## License

Expand Down
9 changes: 8 additions & 1 deletion docs/design/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ configuration without modifying application code.
+----------+----------+-----------+---------------+
| Storage Backend |
| SQLite / PostgreSQL / File-based |
| + Mem0 (initial) / Custom Stack (future) |
| + Mem0 (initial, implemented) / Custom (future)|
| See Decision Log |
+-------------------------------------------------+
```
Expand Down Expand Up @@ -283,6 +283,13 @@ memory:
max_memories_per_agent: 10000
consolidation_interval: "daily"
shared_knowledge_base: true

# Embedder config is passed programmatically via the factory:
# create_memory_backend(config, embedder=Mem0EmbedderConfig(
# provider="<embedding-provider>",
# model="<embedding-model-id>",
# dims=1536,
# ))
```

Configuration is modeled by `CompanyMemoryConfig` (top-level), `MemoryStorageConfig`
Expand Down
3 changes: 1 addition & 2 deletions docs/roadmap/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The SynthOrg core framework is complete. The following subsystems are built and
- Budget and cost management (tracking, enforcement, CFO optimization, quotas)
- Agent engine (execution loops, parallel execution, task decomposition, routing, assignment, recovery, shutdown)
- Communication layer (message bus, delegation, loop prevention, conflict resolution, meeting protocol)
- Memory system (pluggable backend protocol, retrieval pipeline, shared org memory, consolidation)
- Memory system (pluggable backend protocol, Mem0 adapter, retrieval pipeline, shared org memory, consolidation)
- Security and approval system (rule engine, output scanning, progressive trust, autonomy levels, timeout policies)
- Tool system (file system, git, code runner, MCP bridge, sandboxing, permissions)
- HR engine (hiring, firing, onboarding, offboarding, registry, performance tracking, promotions)
Expand All @@ -22,7 +22,6 @@ The SynthOrg core framework is complete. The following subsystems are built and

| Area | Description |
|------|-------------|
| **Mem0 adapter** | Concrete `MemoryBackend` implementation using the Mem0 library |
| **Approval workflow gates** | Runtime wiring for human-in-the-loop approval queues |
| **CLI** | Terminal interface wrapping the REST API (may not be needed) |
| **Web dashboard** | Vue 3 frontend for monitoring and managing the synthetic organization |
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies = [
"litellm==1.82.1",
"litestar[standard,structlog,pydantic,brotli,prometheus]==2.21.1",
"mcp==1.26.0",
"mem0ai==1.0.5",
"pydantic==2.12.5",
"pyjwt[crypto]==2.11.0",
"pyyaml==6.0.3",
Expand Down Expand Up @@ -134,6 +135,7 @@ convention = "google"
"PLR2004", # magic values in tests
"SLF001", # private member access in tests
"PLC0415", # local imports in test functions
"TC", # type-checking imports (fixture type hints)
]
"__init__.py" = ["F401"]
"scripts/**/*.py" = [
Expand Down Expand Up @@ -184,6 +186,10 @@ ignore_missing_imports = true
module = "mcp.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "mem0.*"
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = "litestar.*"
ignore_missing_imports = true
Expand Down
13 changes: 10 additions & 3 deletions src/ai_company/memory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
Re-exports protocols (``MemoryBackend``, ``MemoryCapabilities``,
``SharedKnowledgeStore``, ``MemoryInjectionStrategy``,
``OrgMemoryBackend``, ``ConsolidationStrategy``, ``ArchivalStore``),
domain models, config models, factory, retrieval pipeline,
consolidation, org memory, and error hierarchy so consumers can
import from ``ai_company.memory`` directly.
concrete backends (``Mem0MemoryBackend``), domain models, config
models, factory, retrieval pipeline, consolidation, org memory, and
error hierarchy so consumers can import from ``ai_company.memory``
directly.
Comment on lines +6 to +9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Docstring export list is incomplete.

Line 6 mentions only Mem0MemoryBackend, but Line 13 also re-exports Mem0EmbedderConfig; the public-surface summary is now out of sync.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/ai_company/memory/__init__.py` around lines 6 - 9, The module docstring
in __init__.py lists only Mem0MemoryBackend but the module also re-exports
Mem0EmbedderConfig (and possibly other public symbols); update the top-level
summary to include Mem0EmbedderConfig (and ensure any other names exported in
the file are reflected) so the public-surface description matches the actual
re-exports (search for Mem0MemoryBackend, Mem0EmbedderConfig and the module
__all__/re-export lines to verify and update the docstring).

"""

from ai_company.memory.backends.mem0 import (
Mem0EmbedderConfig,
Mem0MemoryBackend,
)
Comment on lines +12 to +15
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Vendor-specific names in top-level API violate project naming policy.

Re-exporting Mem0EmbedderConfig and Mem0MemoryBackend from ai_company.memory introduces vendor-specific naming into project-owned API on Line 12 and Line 82. Consider exposing generic aliases at the top-level and keeping vendor-specific types under backend-specific modules.

As per coding guidelines, "Never use real vendor names (Anthropic, OpenAI, Claude, GPT, etc.) in project-owned code, docstrings, comments, tests, or config examples. Use generic names: example-provider, example-large-001, example-medium-001, example-small-001, large/medium/small as aliases."

Also applies to: 82-83

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/ai_company/memory/__init__.py` around lines 12 - 15, The top-level module
is re-exporting vendor-specific symbols Mem0EmbedderConfig and
Mem0MemoryBackend; change the top-level API to expose generic aliases (e.g.,
ExampleEmbedderConfig or EmbedderConfig, and ExampleMemoryBackend or
MemoryBackend) instead of vendor names, and leave the original
Mem0EmbedderConfig and Mem0MemoryBackend defined and exported only from
ai_company.memory.backends.mem0; update the __all__/exports in __init__.py to
use the generic alias names and adjust any import sites/docs/tests to import the
generic names (or import vendor-specific types directly from
ai_company.memory.backends.mem0 when needed).

from ai_company.memory.capabilities import MemoryCapabilities
from ai_company.memory.config import (
CompanyMemoryConfig,
Expand Down Expand Up @@ -74,6 +79,8 @@
"DefaultTokenEstimator",
"InjectionPoint",
"InjectionStrategy",
"Mem0EmbedderConfig",
"Mem0MemoryBackend",
"MemoryBackend",
"MemoryCapabilities",
"MemoryCapabilityError",
Expand Down
5 changes: 5 additions & 0 deletions src/ai_company/memory/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Concrete memory backend implementations."""

from ai_company.memory.backends.mem0 import Mem0MemoryBackend

__all__ = ["Mem0MemoryBackend"]
6 changes: 6 additions & 0 deletions src/ai_company/memory/backends/mem0/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
"""Mem0-backed agent memory — adapter, config, and mappers."""

from ai_company.memory.backends.mem0.adapter import Mem0MemoryBackend
from ai_company.memory.backends.mem0.config import Mem0BackendConfig, Mem0EmbedderConfig

__all__ = ["Mem0BackendConfig", "Mem0EmbedderConfig", "Mem0MemoryBackend"]
Loading
Loading