Skip to content

IsaacNewtonne/Agent1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

25 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Agent1

Agent1 is a local-first AI workspace for running a central orchestrator, local worker agents, and permissioned external collaborators from one desktop surface.

The current app centers on the Hybrid Collaboration Workspace: create a project, choose how Agent1 should coordinate the work, attach local or external agents, then talk to Agent1 from the command box while approvals and activity stream through the workspace.

Current App State

  • 🧭 Hybrid Collaboration Workspace: project-first desktop UI with a central Agent1 canvas, local systems lane, external agents lane, activity feed, and command composer.
  • πŸ—‚οΈ Project workflow: create and select projects, keep the active project remembered, and switch collaboration mode from the header.
  • πŸŽ›οΈ Agent1 orchestration: Agent1 is the central user-facing controller. Click the Agent1 node to choose provider and model from available dropdowns.
  • πŸ§‘β€πŸ’» Local agents: add local worker agents, configure provider/model, and delete agents with a custom confirmation dialog.
  • 🌐 External agents and MCP servers: invite or connect external systems from the right lane for project-scoped collaboration.
  • πŸ›‘οΈ Permissions and approvals: local tools use explicit permission policies, external agents use project-scoped permissions, and pending approvals appear in the activity area.
  • 🧠 Model providers: supports OpenCode, Ollama, OpenAI-compatible endpoints, and NVIDIA NIM.
  • ⚑ Live runtime: sessions, events, approvals, projects, and model options are served through the local API.
  • 🧠 Persistent memory: semantic vector storage with cosine similarity search. Agent1 recalls relevant past outcomes before planning.
  • πŸ“Š Hierarchical planning: decompose goals into main steps with nested sub-steps, executed as independent sub-plans.
  • πŸ”„ Self-critique loop: each step is reviewed by a critic agent before marking complete.
  • πŸ’‘ Proactive suggestions: system generates follow-up suggestions for failed or incomplete steps, surfaced in the Memory panel.

Simple User Path

  1. 🚦 Start the API server

    cargo run --bin agent1 -- server --bind 127.0.0.1:17371
  2. πŸ–₯️ Open the desktop app

    cd desktop
    npm install
    npm run tauri:dev

    For browser-only development:

    cd desktop
    npm run dev

    Then open http://localhost:1420.

  3. ✨ Create a project

    Use + Create Project, enter a project name, and choose a collaboration mode:

    Mode Use When
    πŸ€– Automatic Let Agent1 choose the coordination style based on context.
    πŸ“‹ Structured You want a plan, delegated execution, and review.
    πŸš€ Fast You want lower-overhead parallel work.
    πŸ›‘οΈ Careful You want more approval checkpoints before actions.
  4. πŸ” Choose permissions

    Use conservative permissions first:

    • 🧰 Give local agents only the tools they need, such as file read, file list, search, memory, or MCP access.
    • 🚧 Keep file write and shell-style capabilities denied unless the task requires them.
    • πŸͺͺ For external agents, prefer project-scoped permissions: read blackboard, write blackboard, create artifacts, allowed tools, delegation, and max concurrent tasks.
    • βœ… Review approval prompts in the activity feed before allowing sensitive actions.
  5. 🎚️ Configure Agent1

    Click the central A1 node, choose a provider and model from the dropdowns, then save. The setup window closes after saving.

  6. 🀝 Add collaborators

    • πŸ§‘β€πŸ’» Use + Add Agent for local workers.
    • 🌍 Use + Invite External for external agents or MCP-backed systems.
    • πŸ—‘οΈ Delete local agents from their lane when they are no longer needed.
  7. πŸ’¬ Run work

    Type into Agent1 Command and press Run. Agent1 handles the request, records the session, streams activity, and coordinates available agents according to the active project mode.

Architecture

Layer Location Purpose
πŸ–ΌοΈ Desktop UI desktop/ React/Tauri Hybrid Collaboration Workspace.
🧩 CLI/API crates/agent1-cli/ Local API server, CLI commands, routes, and app bootstrap.
βš™οΈ Runtime crates/agent1-runtime/ Agent session execution, tools, approvals, events, and failure handling.
🧠 Models crates/agent1-models/ OpenCode, Ollama, OpenAI-compatible, and NVIDIA NIM model adapters.
πŸ—„οΈ Database crates/agent1-db/ SQLite persistence for agents, sessions, projects, events, approvals, and collaboration records.
🧭 Collaboration crates/agent1-collab/ Project state, collaboration modes, blackboard, tasks, and external agent records.
πŸŒ‰ Gateway crates/agent1-gateway/ Invite-token flow and project-scoped external agent access.
🧠 Memory crates/agent1-memory/ Semantic vector storage with cosine similarity search for persistent memory and suggestions.
🎯 Orchestrator crates/agent1-orchestrator/ Hierarchical planning, step execution, self-critique loop, and memory integration.

API Highlights

Endpoint Description
🩺 GET /api/health Check the local API server.
πŸ§‘β€πŸ’» GET /api/agents List local agents, including Agent1.
βž• POST /api/agents Create or update a local agent.
πŸ—‘οΈ DELETE /api/agents/{agent_id} Delete a local agent. Agent1 cannot be deleted.
🧠 GET /api/models List available models by provider.
πŸ—‚οΈ GET /api/projects List collaboration projects.
✨ POST /api/projects Create a project with a collaboration mode.
πŸŽ›οΈ PATCH /api/projects/{id} Update project settings such as collaboration mode.
πŸͺͺ POST /api/projects/{id}/invite Generate an external invite token for a project.
🌐 GET /api/projects/{id}/externals List external agents for a project.
🧾 GET /api/projects/{id}/blackboard Read project blackboard entries.
βœ… GET /api/projects/{id}/tasks List collaboration tasks.
πŸ“¬ POST /api/projects/{id}/tasks Submit a collaboration task.
πŸ’¬ POST /api/sessions/run Run Agent1 or another agent.
πŸ”Ž GET /api/sessions/{id}/trace Inspect messages, events, tool calls, and approvals for a session.
⚑ GET /ws/events Receive live runtime events.
πŸ” GET /api/memory?query=... Search semantic memory for relevant past outcomes.
✍️ POST /api/memory Write a new memory entry.
πŸ’‘ GET /api/suggestions List pending proactive suggestions.
πŸ’‘ POST /api/suggestions/{id}/accept Accept a suggestion.
πŸ’‘ POST /api/suggestions/{id}/dismiss Dismiss a suggestion.

CLI Commands

Command What It Does
🚦 agent1 server Start the local API server.
πŸ’¬ agent1 run --agent agents/assistant.toml --task "hello" Run an agent from the CLI.
πŸ‘₯ agent1 team --task "..." Run planner, worker, and critic agents.
πŸ” agent1 loop --task "..." --max-runs 5 Run bounded autonomous plan, execute, review iterations with persistent notes.
πŸ” agent1 loops list List registered recurring loops from .agent1/loops.toml.
πŸ” agent1 loops run external-intelligence Run one registered loop through the bounded autonomous loop runner.
🧠 agent1 models --provider ollama List models for a provider. Use --provider nvidia for NVIDIA NIM.
βž• agent1 agent create agents/my-agent.toml Save an agent definition.
🧰 agent1 mcp list List MCP servers.
πŸ“š agent1 sessions List recent sessions.
⚑ agent1 events List recent runtime events.

Model Configuration

Model Routing

Orchestrated runs route roles independently. By default every role uses Ollama llama3.1:8b, but you can override globally or per role:

$env:AGENT1_MODEL_DEFAULT = "llama3.1:8b"
$env:AGENT1_MODEL_CRITIC = "qwen2.5-coder:14b"
$env:AGENT1_MODEL_PLANNER_PROVIDER = "openai_compatible"
$env:AGENT1_MODEL_PLANNER_BASE_URL = "http://localhost:8000/v1"

Supported role suffixes are PLANNER, WORKER, CRITIC, RESEARCHER, BUILDER, REPORTER, and ORCHESTRATOR. Each role also supports _PROVIDER, _BASE_URL, and _CONTEXT overrides.

OpenCode

🧠 OpenCode is available as a provider in the Agent1 configuration dropdown. On Windows, Agent1 launches the OpenCode Node entrypoint directly to avoid shell argument issues with opencode.cmd.

Ollama

πŸ¦™ Run Ollama locally, then configure Agent1 or a worker agent with provider ollama.

ollama serve

πŸ”Œ Optional base URL:

$env:OLLAMA_BASE_URL = "http://localhost:11434"

OpenAI-Compatible APIs

🌐 Use this for local or hosted OpenAI-compatible servers:

$env:OPENAI_BASE_URL = "http://localhost:8000/v1"

NVIDIA NIM

πŸš€ Agent1 supports NVIDIA NIM through the OpenAI-compatible chat completions and models APIs. Set your NVIDIA API key before starting the API server or desktop app:

$env:NVIDIA_API_KEY = "nvapi-..."
cargo run --bin agent1 -- models --provider nvidia

The default NVIDIA base URL is https://integrate.api.nvidia.com/v1. Agent definitions should use provider nvidia and one of the model IDs returned by the model listing command or the desktop dropdown.

Troubleshooting

The desktop cannot connect

🩺 Confirm the API is running:

Invoke-RestMethod http://127.0.0.1:17371/api/health

The command box returns an error

πŸ”Ž Check Agent1's provider/model from the central A1 configuration panel. Then inspect recent sessions and events:

cargo run --bin agent1 -- sessions
cargo run --bin agent1 -- events

The project does not appear after creating it

πŸ”„ Refresh the desktop. Projects are persisted in SQLite and the UI remembers the active project.

A run looks stuck

🧹 Restarting the API marks interrupted running sessions as failed, so stale sessions should not keep the Active counter stuck.

Port in use

πŸšͺ Start the API on another local port:

cargo run --bin agent1 -- server --bind 127.0.0.1:17372

πŸŽ›οΈ Then update the desktop API base setting.

Privacy and Safety

  • 🏠 Agent1 binds the API to localhost for local-first use.
  • πŸ—„οΈ Project, session, agent, and approval data are stored locally in SQLite.
  • πŸ›‘οΈ Tool use is permissioned; sensitive actions should remain approval-gated.
  • πŸͺͺ External agents are project-scoped and should be granted only the permissions needed for the current project.

About

Agent1 uses a hybrid collaboration system that automatically manages shared memory, task routing, events, permissions, and agent coordination so users can focus on the project instead of configuration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors