Frontmatter
| id | 7961 |
| title | Epic: Agent Cognitive Runtime |
| state | Closed |
| labels | epicaiarchitecture |
| assignees | tobiu |
| createdAt | Dec 1, 2025, 11:21 AM |
| updatedAt | Dec 1, 2025, 5:00 PM |
| githubUrl | https://github.com/neomjs/neo/issues/7961 |
| author | tobiu |
| commentsCount | 1 |
| parentIssue | null |
| subIssues | 7962 Implement Neo.ai.provider.Base 7963 Implement Neo.ai.provider.Gemini 7964 Create ContextAssembler for memory integration 7965 Implement Event Queue and Agent Loop 7966 Implement Safety Guardrails for Agent 7968 Integrate Cognitive Loop into Agent Class |
| subIssuesCompleted | 6 |
| subIssuesTotal | 6 |
| blockedBy | [] |
| blocking | [] |
| closedAt | Dec 1, 2025, 5:00 PM |
Epic: Agent Cognitive Runtime
tobiu assigned to @tobiu on Dec 1, 2025, 11:39 AM
tobiu cross-referenced by #7962 on Dec 1, 2025, 11:59 AM
tobiu cross-referenced by #7963 on Dec 1, 2025, 11:59 AM
tobiu added sub-issue #7962 on Dec 1, 2025, 11:59 AM
tobiu added sub-issue #7963 on Dec 1, 2025, 11:59 AM
tobiu cross-referenced by #7964 on Dec 1, 2025, 12:32 PM
tobiu added sub-issue #7964 on Dec 1, 2025, 12:32 PM
tobiu cross-referenced by #7965 on Dec 1, 2025, 1:12 PM
tobiu added sub-issue #7965 on Dec 1, 2025, 1:12 PM
tobiu cross-referenced by #7966 on Dec 1, 2025, 1:46 PM
tobiu added sub-issue #7966 on Dec 1, 2025, 1:46 PM
tobiu cross-referenced by #7968 on Dec 1, 2025, 4:40 PM
tobiu added sub-issue #7967 on Dec 1, 2025, 4:40 PM
tobiu added sub-issue #7968 on Dec 1, 2025, 4:42 PM
tobiu removed sub-issue #7967 on Dec 1, 2025, 4:42 PM

tobiu
Dec 1, 2025, 4:59 PM
Input from Gemini 2.5:
✦ Completed Epic #7961: Agent Cognitive Runtime.
Achievements:
- Strategic Pivot: Shifted focus to "Cognitive Runtime First" to give the Agent a brain before building the nervous system (WebSocket).
- Model Abstraction Layer: Implemented
Neo.ai.provider.BaseandNeo.ai.provider.Gemini. Secured API keys viarequiredEnv.- Context & Memory: Created
Neo.ai.context.Assemblerusing the "Thick Client" pattern to directly accessmemory-coreservices for short-term history and RAG (Long-Term Memory + KB).- Event Loop: Implemented
Neo.ai.agent.Scheduler(Priority Queue) andNeo.ai.agent.Loop(Stimulus-Response Cycle) with Token Bucket rate limiting.- Integration: Upgraded
Neo.ai.Agentto instantiate and orchestrate the cognitive runtime while preserving legacy MCP Client capabilities.- Verification: Validated end-to-end flow with
ai/examples/test-agent.mjs(Agent -> Loop -> Scheduler -> Assembler -> Provider -> Gemini).Next Steps:
- Proceed with Spike #7960 (WebSocket RMA) to give the Agent "Eyes" (Telemetry) and "Remote Hands" (RPC).
- The WebSocket
onMessagehandler will now simply callagent.schedule(event), enabling the "Neural Link".
tobiu closed this issue on Dec 1, 2025, 5:00 PM
tobiu cross-referenced by #7969 on Dec 1, 2025, 5:04 PM
tobiu cross-referenced by #7970 on Dec 1, 2025, 5:04 PM
Goal: Transform
Neo.ai.Agentfrom a passive tool wrapper into an autonomous daemon with perception, reasoning, and action capabilities.Scope:
Neo.ai.provider.Base: Abstract base class for AI providers.Neo.ai.provider.Gemini: Concrete implementation for Google Gemini API.generate(),stream().memory-core(viaget_session_memories).query_raw_memoriesto retrieve relevant past problem-solving patterns.ContextAssemblerthat combines System Prompt + Memory Core History + RAG Results + Current Event into a valid LLM payload.PriorityQueuefor handling incoming signals (System vs User vs Telemetry).Perceive->Reason(LLM) ->Act(Tools/RPC) ->Reflect.component:destroy).Implementation Priority:
Example Scenario: Autonomous Error Recovery
[ERROR] Button-1 failed to mountinspectComponent('Button-1')via RPCtextsetConfigs({id: 'Button-1', text: 'Default'})Agent Initialization Sequence:
Dependencies:
Success Criteria:
Non-Goals (Out of Scope for Epic #7961):
Proposed Sub-Issues:
Neo.ai.provider.Baseabstract class.Neo.ai.provider.Geminiwith API integration.ContextAssemblerfor memory integration.PriorityQueuewith event categorization.Agent.run().Testing Approach:
Reference:
.github/AGENT_ARCHITECTURE.md