chiguyong
ea705b979b
feat(compression): U2 HeadroomCompressor with SmartCrusher and CCR cache
...
Add HeadroomCompressor implementing CompressionStrategy Protocol with
content-type routing (JSON→SmartCrusher, code→CodeCompressor), CCR
reversible compression cache, and graceful degradation when headroom-ai
is not installed.
2026-06-07 18:19:41 +08:00
chiguyong
5d3a5f2bf3
feat(compression): U1 CompressionStrategy Protocol and create_compressor factory
...
Add runtime-checkable CompressionStrategy Protocol with compress(),
compress_tool_result(), and is_available() methods. Add compress_tool_result
and is_available to existing ContextCompressor. Add create_compressor()
factory function with headroom/summary provider routing and ImportError
fallback.
2026-06-07 18:19:27 +08:00
chiguyong
80a505b1c1
docs: mark Phase 6 plan as completed
2026-06-07 17:27:01 +08:00
chiguyong
239009357a
feat(telemetry): U7 OpenTelemetry integration with zero-dependency no-op pattern
...
Add telemetry module with tracing (agent/tool/llm/pipeline_step spans),
metrics (5 histograms/counters), and setup with optional OTLP exporters.
Uses no-op pattern when opentelemetry not installed. GenAI Semantic
Conventions for LLM spans. Integrated into ReactEngine, LLMGateway,
ToolBase, and FastAPI app.
2026-06-07 17:26:21 +08:00
chiguyong
03a5167366
feat(pipeline): U6 step-level retry with exponential backoff and saga compensation
...
Add StepRetryPolicy with jitter-based exponential backoff, SagaOrchestrator
with LIFO compensation pattern, integrate retry_policy and compensate
fields into PipelineStage/PipelineStep schema, add GEO pipeline
compensation definitions for all 7 steps.
2026-06-07 17:26:07 +08:00
chiguyong
4db637cd4f
feat(pipeline): U5 state persistence with Redis hot + PG cold dual-write
...
Add PipelineStateMemory/Redis/PG backends, PipelineStateManager with
Redis Sorted Set hot state + PostgreSQL JSONB cold persistence.
Integrated into PipelineEngine with state persistence calls at each
step transition.
2026-06-07 17:25:52 +08:00
chiguyong
2e547e345a
feat(geo): U4 GEO skill tool binding with BaiduSearch and E2E tests
...
Add BaiduSearchTool (API mode + scraping fallback), bind tools to
GEO skill YAML configs (baidu_search, web_crawl, schema_extract,
schema_generate), extend geo_full_pipeline with generate_content
and deai steps, add 36 E2E integration tests.
2026-06-07 17:25:37 +08:00
chiguyong
9ec1740047
feat(tools): U3 built-in Python tools - WebCrawl, SchemaExtract, SchemaGenerate
...
Add WebCrawlTool (Crawl4AI wrapper with graceful degradation),
SchemaExtractTool (extruct-based Schema.org extraction), and
SchemaGenerateTool (JSON-LD generation with optional pydantic-schemaorg
validation). All tools work without optional dependencies.
2026-06-07 17:25:24 +08:00
chiguyong
550d29a139
feat(mcp): U2 MCP config system and MCPManager lifecycle
...
Add MCPServerConfig dataclass with stdio/streamable_http/sse transport
validation, MCPManager for declarative YAML-driven MCP server lifecycle
(start_all/stop_all), tool discovery and registration. Integrated
into FastAPI lifespan startup/shutdown.
2026-06-07 17:25:07 +08:00
chiguyong
66b9217569
feat(mcp): U1 StdioTransport for subprocess-based MCP communication
...
Add StdioTransport class supporting stdio JSON-RPC over subprocess
stdin/stdout with asyncio.create_subprocess_exec, pending futures
for request/response matching, and stderr forwarding.
2026-06-07 17:24:52 +08:00
chiguyong
9b6c0230c0
docs: add Phase 6 toolkit plan
2026-06-07 16:21:50 +08:00
chiguyong
11a12fed29
docs: mark Phase 5 plan as completed
2026-06-06 22:53:14 +08:00
chiguyong
24e501f745
fix(core): U10 Agent status lock timeout and config hot-reload audit
...
- Added _acquire_status_lock with timeout (30s) to prevent deadlocks
- Added _release_status_lock for safe lock release
- Added config_version tracking on BaseAgent
- Config hot-reload now increments version and propagates to agents
- Audit logging with config version in _on_config_change
2026-06-06 22:52:51 +08:00
chiguyong
83cdddd199
feat(evaluation): U9 Ragas evaluation pipeline for RAG quality assessment
...
- RagasEvaluator: LLM-as-Judge evaluation with ragas lib or built-in fallback
- EvalDatasetBuilder: from traces or dict list
- EvalMetrics: faithfulness, answer_relevancy, context_precision, context_recall
- Built-in heuristic evaluation using keyword overlap and Jaccard similarity
- 13 tests passing
2026-06-06 22:49:27 +08:00
chiguyong
9753a08ac8
feat(llm): U8 Chinese LLM providers - Wenxin, Doubao, Yuanbao
...
- WenxinProvider: Baidu ERNIE via Qianfan v2 OpenAI-compatible API, AK/SK token auth
- DoubaoProvider: ByteDance Doubao via Volcengine Ark API
- YuanbaoProvider: Tencent Hunyuan via OpenAI-compatible API with enhancement mode
- All inherit from OpenAICompatibleProvider for retry/circuit breaker support
- 16 tests passing
2026-06-06 22:46:53 +08:00
chiguyong
34e083abde
feat(evolution): U7 multi-objective fitness and extended strategy space
...
- MultiObjectiveFitness: weighted scoring, NSGA-II Pareto ranking, crowding distance
- FitnessWeights: configurable accuracy/latency/cost weights with auto-normalization
- ExtendedStrategyTuner: multi-dim Bayesian optimization (temperature, max_iterations, top_k, retrieval_mode)
- ExtendedStrategyConfig: expanded parameter space
- 20 tests passing
2026-06-06 22:42:54 +08:00
chiguyong
d5998aaddd
feat(evolution): U6 GEPA genetic algorithm evolution framework
...
- PromptChromosome: instructions + demos + constraints gene segments
- CrossoverOperator: paragraph-level text, demo, constraint crossover
- MutationOperator: LLM-driven instruction mutation + demo/constraint mutation
- GEPAPopulation: tournament selection, elite preservation, Pareto front
- FitnessScore: multi-objective (accuracy, latency, cost) with Pareto dominance
- 29 tests passing
2026-06-06 22:38:55 +08:00
chiguyong
1390bd8d6e
feat(skills): U5 GEO Pipeline orchestration with DAG execution
...
- GEOPipeline: YAML-driven DAG pipeline with parallel/sequential execution
- PipelineStep with input_mapping ($.input.xxx, $.steps.name.output.xxx)
- Topological sort for execution groups, SharedWorkspace integration
- geo_full_pipeline.yaml: detect→analyze→optimize→track workflow
- 10 tests passing
2026-06-06 22:34:24 +08:00
chiguyong
23934602c0
feat(core): U4 multi-agent Orchestrator with SharedWorkspace
...
- Orchestrator: Orchestrator-Worker pattern with LLM-driven task decomposition
- SharedWorkspace: Redis-backed shared state with versioning and distributed locks
- SubTask dependency graph, parallel group building, result aggregation
- 16 tests passing
2026-06-06 22:25:12 +08:00
chiguyong
364fe6bd6d
feat(memory): U3 EpisodicMemory ORM integration - EpisodeModel and session factory
...
- EpisodeModel ORM model with pgvector embedding support
- create_episodic_session_factory for async PostgreSQL sessions
- Server app.py now resolves session_factory from database_url config
- Graceful fallback when database_url not configured
2026-06-06 22:21:00 +08:00
chiguyong
f16dcb5ebe
feat(memory): U2 Contextual Retrieval - LLM-generated context prefixes for chunks
...
- ContextualChunker: generates context prefixes per chunk via LLM
- Integrated into HttpRAGService ingest with contextual_chunking option
- Caching, batch processing, graceful LLM failure handling
- 12 tests passing
2026-06-06 22:19:02 +08:00
chiguyong
a6c9babfdc
feat(memory): U1 RAG self-correction loop (CRAG)
...
- RelevanceScorer: keyword overlap + query coverage + retrieval score + length penalty
- RAGSelfCorrectionLoop: state machine driven retrieve-evaluate-correct-degrade cycle
- Integrated into MemoryRetriever with enable_self_correction option
- 21 tests passing
2026-06-06 22:16:23 +08:00
chiguyong
468dfd71e8
fix(test): adapt health check assertion to Phase 4 status value change
2026-06-06 21:56:30 +08:00
chiguyong
6e362a8ae7
feat(agentkit): Phase 4 enterprise production upgrade — 12 Implementation Units
...
Phase A (P0): EpisodicMemory pgvector search+EmbeddingCache, ReAct timeout+CancellationToken, evolution system fix (A/B test+LLMPromptOptimizer+StrategyTuner), AnthropicProvider native Messages API
Phase B (P1): RetryPolicy+CircuitBreaker, chat_stream fallback chain, WebSocket endpoint, SSE stream fix, Evolution+Memory API routes (7 endpoints), embedding cache+Enhanced Search per-KB degradation fix
Phase C (P2): GeminiProvider native generateContent API, Agent state lock+config hot-reload
Tests: 1301 passed, 18 skipped, 0 failed
2026-06-06 21:51:04 +08:00
chiguyong
e33dc25ad3
feat(memory): RAG pipeline optimization — 5 Implementation Units
...
U1: QueryTransformer — LLM/rule-based query rewriting + sub-query decomposition
U2: HttpRAGService enhanced_search() — rerank + compression via /bases/{kb_id}/retrieve
U3: Structured context injection — source attribution headers in RAG results
U4: RetrieveKnowledgeTool — built-in tool for mid-reasoning knowledge retrieval
U5: Configurable retrieval params + per-KB weights + CJK token estimation
Config example:
memory:
retrieval:
top_k: 5
token_budget: 2000
context_template: structured
query_transform:
enabled: true
strategy: llm
semantic:
search_mode: enhanced
use_rerank: true
kb_weights:
industry-kb-id: 1.2
enterprise-kb-id: 0.8
Tests: 1037 passed, 18 skipped, 0 failed
2026-06-06 19:27:09 +08:00
chiguyong
cd5b39087e
feat(memory): add HttpRAGService for config-driven knowledge base integration
2026-06-06 18:36:05 +08:00
chiguyong
0456429beb
fix(review): address all 14 P2 advisory findings
2026-06-06 18:20:46 +08:00
chiguyong
8620751864
fix(review): address P0+P1 findings from Tier 2 code review
...
P0: MemoryRetriever.retrieve score mutation fix
P1: Redis atomic Lua script, deprecated API fix, SQLite WAL mode,
Redis URL masking, UniqueConstraint, TraceRecorder completed flag,
EpisodicMemory recall improvement, LLMReflector sanitization,
A/B test safety, generator cleanup, ContextCompressor guards,
OpenAIEmbedder reuse, Pipeline failure handling, Metrics O(1),
Health check Redis PING, CLI skill loading, CORS config,
API key direct pass-through
Tests: 924 passed, 18 skipped, 0 failed
2026-06-06 17:57:47 +08:00
chiguyong
f976fade99
docs: mark Phase 3 upgrade plan as completed
2026-06-06 17:18:07 +08:00
chiguyong
f858d279f3
feat(agentkit): Phase 3 upgrade - persistence, memory, evolution, observability
...
10 Implementation Units across 3 phases:
Phase A - Infrastructure:
- U1: RedisTaskStore with Redis/memory backend + factory function
- U2: TraceRecorder for execution trace recording
- U3: PersistentEvolutionStore with SQLite backend
Phase B - Core Capabilities:
- U4: MemoryRetriever integration into ReAct engine
- U5: Embedder abstraction + EpisodicMemory vector search
- U6: LLMReflector for LLM-in-the-loop reflection
- U7: SkillPipeline for multi-skill orchestration
Phase C - Enhancement:
- U8: SKILL.md format + progressive disclosure levels
- U9: ContextCompressor + prompt cache rendering
- U10: Structured logging + metrics endpoint + enhanced health check
Tests: 924 passed, 18 skipped, 0 failed
2026-06-06 17:17:45 +08:00
chiguyong
74e2223153
feat(cli): pair command + doctor rename + client config priority
...
- health → doctor (better naming)
- agentkit pair --name <client> generates ak_live_ API key
- agentkit pair --list / --revoke for client management
- ClientConfig class: client config > init defaults > hardcoded
- README updated with pair usage + business system pairing guide
- 38 CLI tests passing
2026-06-06 13:08:14 +08:00
chiguyong
3cd6a73d86
feat(cli): Docker deployment + README CLI section
...
U5: docker-compose.yaml (agentkit + redis + postgres) + Dockerfile ENTRYPOINT
U6: README updated with CLI quick start + Docker deployment guide
31 CLI tests passing, no regression.
2026-06-06 12:47:47 +08:00
chiguyong
b2709da08b
feat(cli): AgentKit CLI with serve/version/health/task/skill/init/usage
...
U1: CLI framework (Typer) + serve/version/health commands + __main__.py + pyproject scripts
U2: task command group (submit/status/list/cancel) with remote mode
U3: skill command group (list/load/info) with local and remote modes
U4: init command (generates agentkit.yaml/.env.example/docker-compose/skills) + usage command
31 tests passing, TDD workflow.
2026-06-06 12:45:51 +08:00
chiguyong
acec8ff743
feat(evolution): Phase A - lifecycle hooks + EvolutionConfig
...
U11: EvolutionMixin integrated into ConfigDrivenAgent lifecycle
- on_task_complete triggers evolve_after_task
- on_task_failed records failure patterns
- Evolution errors never break main task flow
U12: EvolutionConfig added to SkillConfig
- enabled, reflect_on_failure, auto_apply, min_quality_threshold
- Backward compatible: defaults to enabled=False
21 new tests passing, no regression.
2026-06-06 12:05:56 +08:00
chiguyong
2844eeb548
feat(streaming): Phase C - LLM streaming + ReAct events + SSE endpoint
...
U8: StreamChunk protocol + OpenAI chat_stream + Gateway streaming with usage tracking
U9: ReActEvent dataclass + execute_stream() yielding thinking/tool_call/tool_result/final_answer
U10: POST /tasks/stream SSE endpoint + Client SDK stream_task()
15 new tests passing, no regression.
2026-06-06 11:54:17 +08:00
chiguyong
ec0e221beb
feat(server): Phase D - async task system (TaskStore + BackgroundRunner + API)
...
U5: TaskStore - in-memory task state with TTL cleanup and max records
U6: BackgroundRunner - async task execution with semaphore concurrency control
U7: Task status/result API + cancel endpoint + async submit mode
45 tests passing (28 new + 17 existing, no regression).
2026-06-06 11:39:41 +08:00
chiguyong
5f1c51cf9a
feat(server): Phase B - auth, rate limiting, SSRF protection, handler whitelist
...
U1: API Key authentication middleware (dev mode skip, health whitelist)
U2: Rate limiting middleware (fixed-window, 60 req/min default)
U3: Callback URL SSRF protection (private IP blocking)
U4: custom_handler module prefix whitelist
65 tests passing. CORS conflict fixed.
2026-06-05 23:37:36 +08:00
chiguyong
f87b790c0f
feat(agentkit): v2 Phase 1 - ReAct/LLM Gateway/Skill/Server + review fixes
...
535 unit + 52 integration tests passing. README added.
2026-06-05 23:32:16 +08:00
chiguyong
669ca604e5
feat(configs): add GEO AgentKit Server configuration
...
- llm_config.yaml: DeepSeek + OpenAI-compatible providers with env var substitution
- skills/ (8 YAML): citation_detector, content_generator, deai_agent, geo_optimizer,
monitor, schema_advisor, competitor_analyzer, trend_agent
- Added intent fields for content_generator, competitor_analyzer, trend_agent
- Added quality_gate fields for content_generator, deai_agent, geo_optimizer
- Updated custom_handler paths to configs.geo_handlers
- geo_tools.py: 14 FunctionTools calling GEO Backend via HTTP
- geo_handlers.py: 3 custom handlers (citation/monitor/schema) calling /internal/ API
- geo_server.py: FastAPI factory with LLM Gateway, Tool Registry, Skill Registry
2026-06-05 23:25:14 +08:00
chiguyong
47a848fbcb
feat(deploy): add Dockerfile and .dockerignore for AgentKit Server
...
- Multi-stage build (builder + runner) based on python:3.11-slim
- Installs .[server] extra (fastapi + uvicorn)
- Runs as non-root appuser
- Health check on /api/v1/health
- Default command: uvicorn configs.geo_server:create_geo_app --port 8001
2026-06-05 23:18:44 +08:00
chiguyong
133ae3927e
test(u8): add GEO business integration tests for YAML configs and agent creation
...
41 tests covering:
- 8 YAML config file loading and validation
- ConfigDrivenAgent creation from YAML (llm_generate/tool_call/custom)
- Custom handler routing (citation/monitor/schema)
- Tool registration completeness
- Adapter compatibility (unique names/types, no task overlap)
2026-06-05 17:25:51 +08:00
chiguyong
35f84fd770
test(orchestrator): add multi-agent collaboration integration tests
...
- Pipeline parallel execution with topological grouping
- Conditional stages (execute/skip)
- Circular dependency detection
- Variable resolution ${var.path}
- Handoff message creation and serialization
- DynamicPipeline: conditional, loop, nested
- End-to-end: content production pipeline with handoff
- 18 new tests, total 148 passing
2026-06-04 22:59:29 +08:00
chiguyong
96ea0c2972
feat(mcp,evolution): add Transport layer and Evolution lifecycle integration
...
U5 - MCP Transport:
- Transport abstract base class with connect/disconnect/send_request
- HTTPTransport: Streamable HTTP with JSON-RPC 2.0
- SSETransport: Server-Sent Events + HTTP POST hybrid
- MCPClient: from_transport() factory method
- 31 transport tests
U6 - Evolution Lifecycle:
- EvolutionMixin: reflect → optimize → AB test → apply/rollback
- EvolutionLogEntry: tracks each evolution step
- Integrates with BaseAgent on_task_complete hook
- 10 lifecycle tests
Total: 130 tests passing
2026-06-04 22:55:23 +08:00
chiguyong
cc6a858150
test(memory): add memory system tests with BaseAgent lifecycle integration
...
- InMemoryMemory test implementation
- SemanticMemory: RAG + graph search tests
- MemoryRetriever: weight-based ranking, token budget
- BaseAgent lifecycle: on_task_start loads, on_task_complete stores, on_task_failed records
- 19 new tests, total 89 passing
2026-06-04 22:44:27 +08:00
chiguyong
d73a3391ab
feat(tools): add MCPTool, SequentialChain, ParallelFanOut, DynamicSelector
...
- MCPTool: call remote MCP tools via MCPClient
- SequentialChain: chain tools with output-to-input piping
- ParallelFanOut: execute tools concurrently with merge strategies
- DynamicSelector: keyword/LLM-based tool selection
- 14 new tests, total 70 passing
2026-06-04 22:42:22 +08:00
chiguyong
5a90824c77
feat(core): add ConfigDrivenAgent with YAML-driven agent definition
...
- AgentConfig: YAML/dict config model with validation
- ConfigDrivenAgent: 3 task modes (llm_generate, tool_call, custom)
- StandaloneRunner: auto-discover YAML configs and build agents
- 25 new tests covering all modes and edge cases
- Total: 56 tests passing
2026-06-04 22:39:25 +08:00
chiguyong
2ddffcdf37
chore: add .gitignore and remove cached files
2026-06-04 22:28:44 +08:00
chiguyong
cc3dfd44e3
fix: switch to setuptools for Python 3.14 compatibility
2026-06-04 22:27:06 +08:00
chiguyong
9a6d6fee4e
feat: initial fischer-agentkit package with unified agent architecture
...
- BaseAgent with handle_task() pattern (execute template moved up)
- Protocol: TaskMessage, TaskResult, HandoffMessage, EvolutionEvent
- Tool system: FunctionTool, AgentTool, ToolRegistry with versioning
- Memory system: WorkingMemory (Redis), EpisodicMemory (pgvector), SemanticMemory (RAG adapter), MemoryRetriever (hybrid)
- Evolution engine: Reflector, PromptOptimizer (DSPy-style), StrategyTuner, ABTester, EvolutionStore
- Orchestrator: PipelineEngine (parallel DAG), PipelineLoader (YAML), HandoffManager, DynamicPipeline
- MCP: Server (FastAPI), Client (httpx), MCPTool
- Prompts: PromptTemplate, PromptSection
- Exceptions: full hierarchy including Tool, Schema, Handoff, Evolution errors
- Tests: unit tests for core, tools, protocol, evolution, pipeline
2026-06-04 22:24:06 +08:00