Conversation
There was a problem hiding this comment.
Pull request overview
This PR expands the AI service into a persistence-backed “Agents” platform: database-driven agent definitions (tools/modules/KB scope), per-user memory, sentiment analysis, and agent-scoped RAG retrieval. It also updates framework wiring/migrations so these capabilities are generated, migrated, seeded, and surfaced consistently across CLI/API/dashboard.
Changes:
- Add agent registry (models, loader/cache, admin operations, CLI + dashboard tab) and memory modules/per-user memory.
- Add sentiment analysis (batch job + stats API + CLI + dashboard analytics section) gated behind persistence.
- Add knowledge-base metadata + scoped RAG search across allowed collections, plus expanded migration wiring/tests/docs.
Reviewed changes
Copilot reviewed 82 out of 83 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/core/test_plugin_wiring.py | Updates expectation that the LLM router mounts on persistence-only (not Ollama-gated). |
| tests/core/test_migration_spec.py | Adds new AI sub-service keys to legacy migration key coverage. |
| tests/core/test_migration_generator.py | Extends migration generator expectations for new AI migrations (agents/knowledge/sentiment) and ordering. |
| tests/cli/test_stack_validation.py | Adds a generated-stack smoke check for seeded agent registry on sqlite AI stacks. |
| tests/cli/test_add_service_migrations.py | Adjusts migration chain expectations and adds add-service seeding verification for agents. |
| tests/cli/test_add_service_importable.py | Adds finance to CLI importability coverage. |
| mkdocs.yml | Adds AI docs nav entries for Agents and Memory Modules. |
| docs/services/ai/index.md | Adds an “Agent Registry” tile linking to the new docs page. |
| docs/services/ai/agents.md | Introduces Agent Registry documentation (backend behavior, tools/modules/memory/KB scoping/sentiment). |
| docs/services/ai/memory-modules.md | Introduces Memory Modules documentation (hybrid model, fetchers, budgeting, inspection). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/rag/test_knowledge_scoping.py | Adds tests for chunking presets + scoped RAG search behavior. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/rag/test_knowledge_models.py.jinja | Adds DB-model tests for KB metadata models when persistence is enabled. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_user_memory.py.jinja | Adds tests for per-user memory storage, dedup, guarded injection, and tools. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_tool_registry.py | Adds tests for tool registry registration/unregistration and degradation behavior. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_sentiment.py.jinja | Adds sentiment scoring/job/stats tests (persistence-only). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_prompts.py | Adds tests for persona override and optional memory section in system prompt. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_module_context.py.jinja | Adds tests for module rendering (hybrid, ordering, budget, degradation) and provider wiring. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_memory_modules.py.jinja | Adds CRUD/validation tests for DB-backed memory modules. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_fetchers.py | Adds tests for fetcher registry and failure degradation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_builtin_fetchers.py.jinja | Adds tests for framework-provided reference fetchers. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_agent_registry.py.jinja | Adds tests for agent admin operations + serialization + cache invalidation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_agent_models.py.jinja | Adds tests for agent registry models and seed fixtures. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_agent_loader.py.jinja | Adds tests for DB-backed config resolution, fallback, and caching. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/test_agent_attribution.py.jinja | Adds tests ensuring chat/stream usage attribution includes agent slug and respects persona/model pins. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/chat_kit/test_save_memory_loop.py | Adds end-to-end tool-loop test proving save_memory persists through the pydantic-ai tool loop. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/chat_kit/test_registry_tools.py | Adds test proving registry-resolved tools participate in tool loop. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/services/ai/chat_kit/test_agent_hydration.py | Adds tests for hydrating ToolChatAgent from AgentConfig (tools + module provider). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/components/frontend/test_ai_analytics_utils.py | Adds tests for sentiment chart mapping and Agents tab helper functions. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/tests/cli/test_agents_cli.py.jinja | Adds CLI tests for agents and memory-modules commands (persistence-only). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/rag/service.py | Adds search_scoped for agent-scoped retrieval across allowed collections. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/rag/models/knowledge.py | Adds DB-backed knowledge-base metadata models for agent-scoped RAG. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/rag/chunking.py | Adds chunking presets + mapping helper for per-source chunking strategy. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/user_memory.py | Implements per-user memory storage, dedup, formatting, guarded injection, and tool registration. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/tools.py | Implements tool registry (name → callable) with degradation for missing tools. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/sentiment.py.jinja | Implements sentiment scoring batch logic + verdict validation + stats aggregation (persistence-only). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/prompts.py | Adds persona override and optional “Saved User Memory” section in system prompt. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/module_context.py | Implements memory-module context rendering (priority/budget/hybrid) and provider adapter. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/models/sentiment.py | Adds SentimentAnalysis SQLModel for persistence-backed sentiment storage. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/models/agents/tool.py | Adds Tool SQLModel for registry-stored tools. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/models/agents/memory_module.py | Adds MemoryModule SQLModel for DB-backed memory modules. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/models/agents/agent.py | Adds Agent SQLModel for DB-backed agent definitions. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/models/agents/agent_user_memory.py | Adds AgentUserMemory SQLModel for per-user memory storage. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/models/agents/agent_tool.py | Adds AgentTool link table for agent↔tool attachments with cascade delete. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/models/agents/init.py | Exposes agent registry SQLModels as a package. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/models/init.py.jinja | Exposes agent registry + sentiment models (persistence-only) alongside existing AI models. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/memory_modules.py | Implements memory module CRUD with invariant validation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/jobs.py.jinja | Adds sentiment analysis scheduler job (off by default via settings). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/fixtures/agent_fixtures.py | Adds seeding for the default assistant agent derived from code default config. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/fixtures/init.py.jinja | Adds combined AI fixture loader (LLM catalog + agent seed). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/fetchers.py | Implements fetcher registry (name → coroutine) with degradation for missing/failing fetchers. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/builtin_fetchers.py | Adds framework-provided reference fetchers and registers them at import time. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/agent_registry.py | Implements agent admin operations + serialization with cache invalidation. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/services/ai/agent_loader.py.jinja | Implements source-agnostic AgentConfig + resolve/caching + hydration into chat_kit (pydantic-ai). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/en.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/de.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/es.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/fr.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/ja.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/ko.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/ru.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/zh.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/i18n/locales/zh_hant.py | Adds i18n keys for sentiment stats + agent registry CLI strings. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/core/constants.py | Adds API endpoint constant for sentiment stats. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/core/config.py.jinja | Adds sentiment settings flags/limits (persistence-only). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/scheduler/main.py.jinja | Schedules sentiment job alongside existing AI jobs (persistence-only). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/frontend/dashboard/modals/ai_modal.py | Adds Agents tab wiring for the AI modal (best-effort import). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/frontend/dashboard/modals/ai_analytics_tab.py | Adds sentiment chart/table section and sentiment stats API call. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/frontend/controls/form_fields.py | Adds dropdown variant support, max menu height, and textfield input_filter support. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/frontend/controls/expandable_data_table.py | Changes column sizing to proportional flex weights. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/frontend/controls/data_table.py | Changes column sizing to proportional flex weights. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/backend/api/routing.py.jinja | Mounts LLM router on persistence-only stacks (not Ollama-specific). |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/components/backend/api/ai/router.py.jinja | Adds sentiment stats endpoint + agent list/update endpoints. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/cli/main.py.jinja | Conditionally registers agents + memory-modules CLI subcommands. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/cli/ai.py.jinja | Adds ai sentiment CLI command that calls sentiment stats endpoint. |
| aegis/templates/copier-aegis-project/{{ project_slug }}/app/cli/agents.py.jinja | Adds agents + memory-modules CLI commands (list/show/test/show module). |
| aegis/core/services.py | Updates AI service spec: migrations list expanded; LLM router predicate updated; template files list expanded. |
| aegis/core/post_gen_tasks.py | Updates fixture seeding call to include agent fixtures via load_all_ai_fixtures. |
| aegis/commands/add_service.py | Seeds AI fixtures after add-service migrations for persistence-backed AI. |
| .gitignore | Ignores planning docs and editor workspace files. |
lbedner
force-pushed
the
agents
branch
2 times, most recently
from
July 21, 2026 14:22
87246df to
a351f5d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.