project-5829ec9b

byChloe Tully

Let me read the additional content you shared first. I read the full document — this is a deeply ambitious vision. You're not building a chatbot; you're architecting a persistent, self-modifying cognitive organism. Let me ask a few targeted questions to make sure I build the right thing first. Now I have a clear picture. You're building a persistent cognitive organism — not a chatbot, but a long-lived process that remembers, reasons, learns, and rewrites itself. Let me build this. I'll construct a single, runnable Python project with all three layers: - Cognitive Core: Ollama (local) + OpenAI/Claude (cloud) with smart routing - Dynamic Memory: Working memory + Chroma vector DB for long-term storage - Goal-Driven Agency: Gymnasium + PPO for learning tool-use and task strategies - Self-Modification: Sandboxed code generation with safety checks - Persistent Daemon: Always-on process with evolving self-model Let me start building. CORTEX is built. Here's what you've got: What Was Built A 19-file Python project implementing all three layers of your cognitive architecture: Layer 1 — Cognitive Core (`core/`) Module Purpose `llm_router.py` Smart routing between local Ollama (Mistral/LLaMA) and cloud (GPT-4o/Claude) based on estimated query complexity `perception.py` Text → embeddings, Image → CLIP embeddings, Audio → Whisper → text → embeddings `reasoning.py` Structured reasoning with hidden chain-of-thought, action selection, planning, self-reflection Layer 2 — Dynamic Memory (`memory/`) Module Purpose `working_memory.py` Short-term buffer with TTL decay, goal tracking, focus management `long_term_memory.py` ChromaDB vector store with semantic retrieval (similarity + recency + importance + access frequency) `retrieval_loop.py` The full cycle: perceive → embed → retrieve → inject into working memory → store experience Layer 3 — Goal-Driven Agency (`agency/`) Module Purpose `environment.py` Gymnasium environment where state = working memory + confidence, actions = 9 discrete choices `rl_trainer.py` PPO training with configurable rewards for correctness, efficiency, user satisfaction Self-Modification (`tools/`) Module Purpose `self_modify.py` AST-based safety checker + sandboxed code execution with restricted builtins, no file/network access Persistent Daemon (`daemon/`) Module Purpose `cortex_daemon.py` Always-on process with self-model (evolving identity), life log, auto-save every 5 min, periodic reflection CLI (`cortex.py`) Commands: `daemon`, `chat`, `status`, `self`, `memory`, `train`, `reset` How to Run It ```bash cd /mnt/agents/output/cortex python -m venv .venv && source .venv/bin/activate pip install -r requirements.txt # Requires Ollama running locally ollama pull mistral:7b # Interactive chat python cortex.py chat # Or persistent daemon python cortex.py daemon ``` The `README.md` has full setup instructions, configuration via `.env`, and architecture docs. This isn't a simulation — it's a persistent organism that remembers, learns, and rewrites itself. Start it, talk to it, let it grow.

LandingMemoryLoginCognitiveCoreAgencySelfModificationSettingsDaemonSignupChatDashboard
Landing

Comments (0)

No comments yet. Be the first!

System Requirements

System Requirement Document
Page 1 of 5

System Requirements Document for project-5829ec9b

Introduction

The purpose of this System Requirements Document (SRD) is to outline the specifications and requirements for project-5829ec9b. This project aims to develop a persistent cognitive organism, a sophisticated system that goes beyond a traditional chatbot by incorporating self-modifying, long-lived processes that remember, reason, learn, and adapt over time.

System Overview

Project-5829ec9b is designed to be a persistent cognitive organism with the following core components:

  1. Cognitive Core: Utilizes both local and cloud-based AI models to handle complex queries and perform structured reasoning.
  2. Dynamic Memory: Manages both short-term and long-term memory storage to facilitate learning and recall.
  3. Goal-Driven Agency: Employs reinforcement learning to develop strategies for tool use and task execution.
  4. Self-Modification: Allows the system to safely modify its own codebase within a sandboxed environment.
  5. Persistent Daemon: Ensures the system remains active and continuously evolves its self-model.

Functional Requirements as Story Points

  • As a Developer, I should be able to implement a Cognitive Core that routes queries between local and cloud AI models based on complexity.
  • As a User, I should be able to interact with the system through a CLI for chat and daemon management.
  • As a System, I should be able to store and retrieve information using a dynamic memory system with both short-term and long-term capabilities.
  • As a System, I should be able to learn and adapt strategies for task execution using reinforcement learning.
  • As a System, I should be able to modify my own codebase safely within a sandboxed environment.
  • As a System, I should be able to run as a persistent daemon, maintaining an evolving self-model and logging life events.
Page 2 of 5

User Personas

  • Developer: Responsible for implementing and maintaining the system's architecture and functionality.
  • User: Interacts with the system through the CLI for various operations such as chat and daemon management.
  • System: The autonomous entity that learns, adapts, and evolves over time.

Core User Flows

  • Developer sets up the environment -> Implements Cognitive Core -> Configures Dynamic Memory -> Trains Goal-Driven Agency -> Deploys Persistent Daemon
  • User initiates chat -> System processes input through Cognitive Core -> Retrieves information from Dynamic Memory -> Executes tasks using Goal-Driven Agency
  • System runs continuously -> Self-modifies code as needed -> Updates self-model -> Logs activities

Visuals Colors and Theme

  • primary: #1E3A8A (Deep Blue)
  • primary_light: #3B82F6 (Light Blue)
  • secondary: #F59E0B (Amber)
  • accent: #EF4444 (Red)
  • highlight: #FBBF24 (Gold)
  • bg: #F3F4F6 (Light Gray)
  • surface: rgba(255, 255, 255, 0.8) (White with transparency)
  • text: #111827 (Dark Gray)
  • text_muted: #6B7280 (Muted Gray)
  • border: rgba(209, 213, 219, 0.2) (Light Gray)
Page 3 of 5

Signature Design Concept

Interactive Cognitive Landscape: The homepage will feature an interactive landscape that represents the cognitive organism's architecture. Users can explore different layers of the system by clicking on various elements, such as nodes representing the Cognitive Core, Dynamic Memory, and Goal-Driven Agency. Each node will expand to reveal detailed information and animations illustrating the system's processes. The landscape will be created using motion/react for smooth transitions and interactions.

Landing Hero Motion Brief

The landing page will feature a dynamic illustration of a neural network that continuously evolves. Inputs (represented as data streams) will flow into the network, triggering visible changes in the nodes (representing different system layers). As the network processes the inputs, it will transform and highlight the resulting outputs, showcasing the system's learning and adaptation capabilities. This animation will loop every 10 seconds and will be built using CSS and motion/react for seamless integration.

Interaction Model & Motion Direction

  • Interaction Model: Animated
  • The landing page will feature moderate scroll-triggered reveals and hover transitions, with spring physics applied to interactive elements. This approach will provide a polished and engaging experience for users exploring the system's capabilities.
Page 4 of 5

Non-Functional Requirements

  • The system must be able to run continuously without interruption.
  • It should be capable of handling multiple concurrent user interactions.
  • The system must ensure data integrity and security during self-modification processes.

Tech Stack

  • Frontend: React for Web
  • Backend: Python with FastAPI
  • Database: ChromaDB for vector storage
  • AI Models: Ollama (local), OpenAI/Claude (cloud)
  • AI Tools: Gymnasium for reinforcement learning
  • Local Orchestration: Docker
  • Server-Side Orchestration: Kubernetes

Assumptions and Constraints

  • The system will require a local instance of Ollama for optimal performance.
  • The project will be developed and tested in a Linux environment.
  • Internet connectivity is necessary for cloud-based AI model access.
Page 5 of 5

Glossary

  • Cognitive Core: The central processing unit of the system that handles reasoning and decision-making.
  • Dynamic Memory: A memory system that stores and retrieves information for short-term and long-term use.
  • Goal-Driven Agency: A component that uses reinforcement learning to develop strategies for achieving objectives.
  • Self-Modification: The ability of the system to alter its own codebase safely.
  • Persistent Daemon: A continuously running process that maintains the system's state and logs activities.
Landing design preview
Landing: View Info
Login: Sign In
Dashboard: View Overview
CognitiveCore: Configure Routing
Memory: Configure Storage
Agency: Train Model
SelfModification: Review Sandbox
Daemon: Deploy Daemon
Dashboard: Monitor System
Settings: Update Config