refactor(core-ai): comprehensive cleanup - PydanticAI only architecture
Remove all obsolete agent implementations and framework references. Keep only PydanticAI (primary) and SimpleLiteLLM (fallback). This cleanup eliminates confusion between multiple frameworks that were tried during development (LangChain, LangGraph, ADK, OllamaNative) and establishes PydanticAI as the single agent framework going forward. BREAKING CHANGES: - Removed OllamaNativeAgent - use PydanticAgent instead - Removed /test/ollama-tools diagnostic endpoint - Default /v1/chat/completions now uses PydanticAgent Files Deleted (32 total): - Obsolete agents: ollama_native_agent.py - Diagnostic files: ARCHITECTURE.md, DIAGNOSTIC_RESULTS.md, PHASE*.md - Legacy tools: src/tools.py - Test files: test_ai_flow_quality.py, test_02/03 (diagnostic layers) - Documentation: ADK_Ollama_Research.md, agent-flow-diagrams.md - Session docs: 3 files with LangChain/LangGraph implementations - Plans: 5 completed plans about obsolete frameworks - Migration docs: MIGRATION_PLAN_LANGCHAIN_TO_ADK.md Files Modified (8 total): - main.py: Refactored to PydanticAI only (305 lines vs 457 before) - agents/__init__.py: Removed OllamaNativeAgent exports - README.md: Complete rewrite for PydanticAI architecture - prompts.py: Updated for PydanticAI (infrastructure tool guidance) - STATUS.md: Updated to v0.11.0-pydantic-ai - CHANGELOG.md: Added v0.11.0 entry documenting cleanup - plans/active/*.md: Updated to reference PydanticAI Current Architecture: - Framework: PydanticAI with native Ollama SDK - Agents: PydanticAgent (primary) + SimpleLiteLLMAgent (fallback) - Model: mistral-nemo:latest - Tools: 6 core + 28+ OpenAPI-discovered - Memory: 3-tier system with Qdrant - VRAM: ~4-6GB Lines Removed: ~3000+ lines of obsolete code 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
# Project Status
|
||||
|
||||
> **Last Updated:** 2025-11-26
|
||||
> **Version:** 0.10.0-adk-migration
|
||||
> **Last Updated:** 2025-12-03
|
||||
> **Version:** 0.11.0-pydantic-ai
|
||||
|
||||
## Current Phase
|
||||
|
||||
**Active Work:** AI Infrastructure Optimization & System Hardening
|
||||
**Status:** ✅ **STABLE** - ADK Migration Complete, All Systems Operational
|
||||
**Status:** ✅ **STABLE** - PydanticAI Implementation Complete, All Systems Operational
|
||||
|
||||
See [PLANS.md](PLANS.md) for complete implementation roadmap and [CHANGELOG.md](CHANGELOG.md) for version history.
|
||||
|
||||
@@ -99,42 +99,40 @@ See [PLANS.md](PLANS.md) for complete implementation roadmap and [CHANGELOG.md](
|
||||
- **Memory Retrieval:** Dual-check buffer + Qdrant for cross-restart persistence
|
||||
- **Status:** 32 points stored, tested with multiple users, recall working after restarts
|
||||
|
||||
### Priority 4: AI Orchestrator - Framework Migration ✅ COMPLETE (2025-11-26)
|
||||
- [x] **Phase 3:** Research Capabilities (DuckDuckGo, web scraping) - COMPLETE (2025-11-24)
|
||||
- [x] **Framework Migration:** LangChain/LangGraph → Google ADK - COMPLETE (2025-11-26)
|
||||
- [x] Migrate agent orchestrator to Google ADK with LiteLLM
|
||||
- [x] Convert all 9 tools to ADK async generator format
|
||||
- [x] Update streaming pipeline for ADK event format
|
||||
- [x] Switch model to gemma3:12b with ADK-optimized prompts
|
||||
- [x] Implement comprehensive agent health checks
|
||||
- [x] Update requirements.txt (remove langchain*, add google-adk)
|
||||
### Priority 4: AI Orchestrator - PydanticAI Implementation ✅ COMPLETE (2025-12-03)
|
||||
- [x] **Phase 3:** Research Capabilities (web search, web scraping) - COMPLETE
|
||||
- [x] **Framework Cleanup:** Remove obsolete frameworks (ADK, LangChain, LangGraph, OllamaNative)
|
||||
- [x] **PydanticAI Agent:** Primary agent with tool calling and memory support
|
||||
- [x] **Tool System:** Local tools + OpenAPI discovery from core-api
|
||||
- [x] **Memory Integration:** 3-tier system with Qdrant vector storage
|
||||
- [x] **Code Cleanup:** Removed all diagnostic files and obsolete implementations
|
||||
- [x] **Documentation Update:** Updated all docs to reflect PydanticAI architecture
|
||||
- [x] Production testing and validation
|
||||
|
||||
**Current Implementation (as of 2025-11-26):**
|
||||
- **Framework:** Google ADK 1.3.0 with LiteLLM 1.80.5 (migrated from LangChain)
|
||||
- **Model:** gemma3:12b (upgraded from mistral:7b)
|
||||
- **System Prompt:** v7_adk_best_practice (optimized for ADK)
|
||||
- **Total Tool Count:** 9 tools (7 infrastructure + 2 research)
|
||||
- **Tools Format:** ADK async generators with proper streaming support
|
||||
- **Architecture:** UnifiedAgent with stateless sessions
|
||||
**Current Implementation (as of 2025-12-03):**
|
||||
- **Framework:** PydanticAI with native Ollama SDK
|
||||
- **Model:** mistral-nemo:latest (optimized for tool calling)
|
||||
- **System Prompt:** Tatlock persona with infrastructure tool guidance
|
||||
- **Agent:** PydanticAgent (primary) + SimpleLiteLLMAgent (fallback)
|
||||
- **Tool Discovery:** Local tools + OpenAPI auto-discovery from core-api
|
||||
- **Architecture:** Clean PydanticAI-only implementation
|
||||
|
||||
**Tools Available:**
|
||||
- **Infrastructure (7):** get_current_time, list_services, get_service_details, list_stacks, get_stack_details, list_npm_hosts, get_npm_host_details
|
||||
- **Research (2):** web_search (DuckDuckGo + auto-scrape), web_scrape (targeted extraction)
|
||||
- **Core Tools (6):** get_current_time, get_current_date, calculate_date_difference, add_days_to_date, calculate, web_search
|
||||
- **Infrastructure Tools (28+):** Discovered via OpenAPI from core-api (services, DNS, domains, monitoring, etc.)
|
||||
|
||||
**Migration Benefits Achieved:**
|
||||
- ✅ Improved tool calling reliability with Ollama models
|
||||
- ✅ Better streaming support with ADK event system
|
||||
- ✅ Model flexibility (works with Gemma, Mistral, Qwen families)
|
||||
- ✅ Cleaner architecture with unified agent pattern
|
||||
- ✅ Production-ready health monitoring
|
||||
**Benefits:**
|
||||
- ✅ Type-safe tool definitions with Pydantic validation
|
||||
- ✅ Native Ollama SDK integration (no compatibility layers)
|
||||
- ✅ Dynamic tool discovery via OpenAPI spec
|
||||
- ✅ Clean architecture with single framework
|
||||
- ✅ Better maintainability (no framework confusion)
|
||||
|
||||
**Performance Metrics (Post-Migration):**
|
||||
- **Simple queries:** ~0.3-1s response time
|
||||
- **Tool-using queries:** ~2-5s response time
|
||||
- **Research queries:** ~4-7s response time
|
||||
- **Tool calling success rate:** Monitoring in progress
|
||||
- **VRAM usage:** ~8GB with gemma3:12b
|
||||
**Performance Metrics:**
|
||||
- **Simple queries:** ~1-3s response time
|
||||
- **Tool-using queries:** ~2-8s response time
|
||||
- **Memory:** Persistent across restarts via Qdrant
|
||||
- **VRAM usage:** ~4-6GB with mistral-nemo:latest
|
||||
|
||||
**Optional Future Enhancements (deferred):**
|
||||
- Multi-agent routing patterns (Phase 4+)
|
||||
@@ -158,7 +156,7 @@ See [PLANS.md](PLANS.md) for complete implementation roadmap and [CHANGELOG.md](
|
||||
| **Remote Access** | Working | Ready | 🟢 Headscale + NPM |
|
||||
| **Firewall Active** | Yes | Yes | 🟢 UFW Configured |
|
||||
| **Backups Configured** | Yes | Yes | 🟢 Daily @ 3 AM |
|
||||
| **AI Orchestrator** | Phase 6 | Phase 4 ✅ | 🟢 ADK Migration Complete |
|
||||
| **AI Orchestrator** | Phase 6 | Phase 4 ✅ | 🟢 PydanticAI Complete |
|
||||
| **SSO (Authentik)** | Phase 5 | Core Complete ✅ | 🟢 Organizr + Core API Protected |
|
||||
|
||||
## Quick Reference
|
||||
|
||||
Reference in New Issue
Block a user