NeoPsyke

NeoPsyke

An open-source autonomous AI agent built around a cognitive architecture inspired by Freud's structural model of the Psyche.

It is designed to generate internal motivation, maintain durable goals and memory, do useful work through a full agent runtime, and route actions through explicit governance.

experimental · v0.1.0

The idea

NeoPsyke is organized around three modules inspired by Freud's structural model, wired into a continuous loop where motivation, planning, and governance are separate, explicit, and always running.

LLMs simulate the internal cognitive roles. Around that core, NeoPsyke provides short-term, long-term, and episodic memory, durable and recurring goals, and a layered security model built into the runtime.

Why it's different How it works What exists today Limitations Quick start Contribute

Why it's different

Internal motivation is explicit, not incidental. In many agent systems, proactivity is added through schedules, triggers, or external orchestration. Here, motivation is part of the runtime: the agent is driven by generic internal prompts rather than narrowly predefined tasks, so it has to decide for itself what deserves attention and what kind of work to pursue.

That comes with real tradeoffs. A system driven by open-ended internal prompts is less predictable than one built around fixed workflows, and it can spend tokens exploring paths that do not lead to useful work. But that exploratory overhead is part of the experiment, not just a failure mode.

Governance is structural, not decorative. The system carries provenance and trust metadata through the pipeline, narrows the action surface before execution, and records authorization decisions as durable artifacts rather than conversational state.

Part of that judgment is deterministic, and part of it is contextual and model-dependent. That creates its own challenge: the policy layer has to be tuned carefully enough that the models do not over-generalize and block everything, or become too permissive and approve too much. That tuning problem is also part of the experiment.

The modules stay narrow. The Id generates pressure. The Ego mediates and plans. The Superego governs. This separation does not solve everything, but it makes the system easier to inspect and harder to treat as a black box.

How it works

+-----------+ | Id | Drives accumulate pressure over time. +-----+-----+ When urgent, impulses are sent to the Ego. | v User input -----> SensoryCortex -----> Ego (Planner + Attention) ^ | | +---> DecisionVerifier (is this ready?) Feedback as +---> Superego (is this allowed?) new stimuli +---> MotorCortex (execute action) | | +------------------------+ | MemorySystem (short-term + long-term + episodic) GoalManager (durable, recurring, scheduled goals)
  1. Stimulus — A stimulus reaches the SensoryCortex: a user message, an Id impulse, a goal signal, tool feedback, or a timer cue. Each carries security metadata.
  2. Planning — The Ego attends to the highest-priority input, forms an intention, and the DecisionVerifier checks whether it is grounded and ready to commit.
  3. Governance — The Superego judges the candidate intention against policy and safety constraints before execution is allowed.
  4. Execution — The MotorCortex executes the action through discovered plugins. Feedback re-enters the system as new stimuli, closing the loop.

The Ego runs in a bounded loop (configurable, default 180 steps per input) to prevent runaway reasoning. A meta-reasoner monitors decision pressure and intervenes if the planning chain stalls or loops.

For deeper runtime details, the security model, and why the project uses Kotlin, see the repository README and docs.

What exists today

This is not just a conceptual sketch. NeoPsyke already has a strong architectural base implemented in a full agent runtime with goals, memory, tools, integrations, and action control. It also has a powerful validation harness, including full record, replay, and divergence capabilities, that gives the project a solid development foundation. Even so, it remains a work in progress, with meaningful gaps in stability, evaluation, and breadth of action coverage.

Current limitations

The architecture is real and implemented, and the project already has a solid base, but it should still be evaluated as an experimental system rather than a mature general-purpose agent. The limitations should be stated plainly.

Some omissions are deliberate. For example, NeoPsyke does not currently use sub-agents, not because delegation is uninteresting, but because trust propagation, authority boundaries, and containment need a deliberate security architecture behind them first.

Those are not footnotes. They are part of the current state of the project.

Quick start

Prerequisites: JDK 21+, at least one LLM API key, Docker optional. For contributors using the Freud validation harness, also install Go 1.26+.

git clone https://github.com/neopsyke/neopsyke.git cd neopsyke ./gradlew installDist cp examples/runtime-config/llm-runtime.external.example.yaml llm-runtime.yaml export GOOGLE_API_KEY="..." # or ANTHROPIC_API_KEY, GROQ_API_KEY, MISTRAL_API_KEY, OPENAI_API_KEY, OLLAMA_API_KEY ./run-neopsyke doctor ./run-neopsyke # Dashboard at http://localhost:8787

See the Getting Started guide for the full first-run flow, sample prompts, the dashboard walkthrough, and setup notes that match the repository docs.

Read more

Get involved

NeoPsyke is experimental and under active development. Contributions, feedback, and ideas are welcome.