MCPcopy Index your code
hub / github.com/MagicCube/agentara

github.com/MagicCube/agentara @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
1,013 symbols 2,237 edges 205 files 78 documented · 8%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

📯 Agentara

CI Test License: MIT Bun TypeScript Hono React

ADF7F867-88A5-4623-B5A9-06D1CDF4C28E_1_201_a 1

Meet Tara, your 24/7 personal assistant powered by Claude Code and OpenAI Codex. Multi-channel messaging, long-term memory, skills, task scheduling, session management, and more — all running locally.

Features

  • Agent-powered sessions — Interact with Claude Code and OpenAI Codex through managed sessions with full streaming support
  • Multi-channel messaging — Receive and respond to messages from multiple channels (e.g. Feishu/Lark)
  • Message streaming — Streaming response for IM channel (if supported message updating/patching, e.g. Feishu)
  • Task scheduling — Queue-based task dispatcher with per-session serial execution and cross-session concurrency
  • Cron jobs — Schedule recurring tasks with cron patterns
  • Session persistence — Sessions stored as JSONL files with full message history
  • Web dashboard — React-based UI for managing sessions, tasks, and memory
  • File and image support — Send and receive files and images through message channels
  • RESTful API — Hono-based API server with type-safe RPC client

Built-in Skills

Tech Stack

Backend

Category Technology
Runtime Bun
Language TypeScript
API Hono
Database SQLite (Bun built-in) + Drizzle ORM
Task Queue Bunqueue
Validation Zod
Logging Pino
Date Day.js
Events EventEmitter3

Frontend

Category Technology
Framework React 19 + Vite 7
Routing TanStack Router
Data Fetching TanStack React Query
Styling Tailwind CSS v4 + Shadcn
Theme Dark mode by default

Prerequisites

Quick Start

First, clone the repo and install all its dependencies.

git clone https://github.com/magiccube/agentara.git
cd agentara
make install

Then, run in DEVELOPMENT mode. Both backend server and frontend website will be launched.

make dev

On first run, Agentara creates ~/.agentara with default config, workspace, and data directories.

The backend runs on http://localhost:1984 and the frontend dev server on http://localhost:8000 (proxying API requests to the backend).

Go to your IM client and start chatting with Tara:

/bootstrap

Or schedule a cronjob:

Hey, Tara! Schedule a cronjob to run every 7:30 AM and 5:30 PM to run the `/pulse` skill.

Configuration

Environment Variables

Variable Description Default
AGENTARA_HOME Home directory for all Agentara data ~/.agentara
AGENTARA_LOG_LEVEL Log level (trace, debug, info, warn, error) info
AGENTARA_SERVICE_PORT API server port 1984
AGENTARA_SERVICE_HOST API server host localhost

Config File

A config.yaml is auto-generated at $AGENTARA_HOME/config.yaml on first run. Here is an example:

agents:
  default:
    type: claude          # Agent runner to use

tasking:
  max_retries: 1          # Max attempts per task before marking as failed

messaging:
  default_channel_id: 9e3eae94-fe88-4043-af40-e7f88943a370  # Change it to yours
  channels:
    - id: 9e3eae94-fe88-4043-af40-e7f88943a370 # Unique ID for the channel
      type: feishu
      name: Tara
      description: Tara's default channel
      params:
        app_id: $FEISHU_APP_ID       # Resolved from environment variable
        app_secret: $FEISHU_APP_SECRET
        chat_id: oc_xxxxxxxxxxxxx

String values starting with $ are automatically resolved from environment variables at load time. All fields are validated with Zod on startup — missing or invalid values will produce a clear error.

Directory Structure

All data lives under $AGENTARA_HOME (~/.agentara by default):

~/.agentara/
├── config.yaml       # Configuration file
├── workspace/        # Agent workspace
├── sessions/         # Session JSONL files
├── memory/           # Agent memory
└── data/             # SQLite databases

Architecture Overview

architecture

Project Structure

src/
├── shared/           # Cross-layer types, utilities, conventions
│   ├── agents/       # AgentRunner interface
│   ├── messaging/    # Message types, channels, gateway
│   ├── tasking/      # Task payload types
│   ├── sessioning/   # Session types
│   ├── config/       # Paths and configuration
│   ├── logging/      # Pino logger
│   └── utils/        # Pure utilities
├── kernel/           # Core orchestration
│   ├── agents/       # Agent runner factory
│   ├── sessioning/   # Session, SessionManager
│   ├── tasking/      # TaskDispatcher (Bunqueue)
│   └── messaging/    # Multi-channel message gateway
├── community/        # Provider implementations
│   ├── anthropic/    # Claude agent runner
│   └── feishu/       # Feishu/Lark messaging channel
├── server/           # Hono API server
├── data/             # Database connection
└── boot-loader/      # Bootstrap and integrity verification
web/                  # React frontend (separate package)

Scripts

Command Description
bun run dev Start backend and frontend in dev mode
bun run dev:server Start backend only
bun run dev:web Start frontend only
bun run check Type-check and lint
bun run build:bin Compile to a standalone binary
bun run build:js Build JS bundle

Contributing

Contributions are welcome! Here's how to get started:

  1. Fork the repository
  2. Create a branch for your feature or fix: git checkout -b feat/my-feature
  3. Install dependencies: bun install
  4. Make your changes and ensure they pass checks: bash bun run check # Type-check + lint
  5. Commit with a clear message following Conventional Commits:
  6. feat: for new features
  7. fix: for bug fixes
  8. chore: for maintenance
  9. docs: for documentation
  10. Open a Pull Request against main

Code Conventions

  • Use logger from @/shared for logging — never use console.log directly
  • Import from @/shared directly, not from sub-paths
  • Entities are defined with Zod schemas first, TypeScript interfaces second
  • Use underscore naming for entity fields
  • Private class members are prefixed with _
  • Provide TSDoc for all public APIs

License

MIT

Extension points exported contracts — how you extend this code

AgentRunner (Interface)
(no doc) [9 implementers]
src/shared/agents/agent-runner.ts
SessionWriter (Interface)
(no doc) [7 implementers]
src/kernel/sessioning/writers/session-writer.ts
HookInput (Interface)
* Hook script for the handoff plugin. * * Reads hook JSON from stdin. If the user typed /handoff, extracts * session_
plugins/handoff/scripts/handoff.ts
SpeechRecognition (Interface)
(no doc) [2 implementers]
web/src/components/ai-elements/speech-input.tsx
MessageReceiveEventData (Interface)
(no doc)
src/community/feishu/messaging/types/events.ts
MessageChannel (Interface)
(no doc) [3 implementers]
src/shared/messaging/message-channel.ts
TaskJobData (Interface)
* Internal wrapper that pairs a session ID with the task payload * for transport through the bunqueue job queue.
src/kernel/tasking/task-dispatcher.ts
FileRoutesByFullPath (Interface)
(no doc)
web/src/routeTree.gen.ts

Core symbols most depended-on inside this repo

cn
called by 462
web/src/lib/utils.ts
run
called by 22
src/kernel/sessioning/session.ts
extractTextContent
called by 17
src/shared/messaging/utils/index.ts
createLogger
called by 15
src/shared/logging/index.ts
_renderStep
called by 12
src/community/feishu/messaging/message-renderer.ts
uuid
called by 10
src/shared/utils/uuid.ts
route
called by 10
src/kernel/tasking/task-dispatcher.ts
stop
called by 9
web/src/components/ai-elements/speech-input.tsx

Shape

Function 709
Interface 137
Method 127
Class 40

Languages

TypeScript100%

Modules by API surface

web/src/components/ai-elements/prompt-input.tsx49 symbols
web/src/components/ai-elements/code-block.tsx27 symbols
web/src/components/ui/sidebar.tsx25 symbols
web/src/components/ai-elements/commit.tsx24 symbols
web/src/components/ai-elements/test-results.tsx23 symbols
src/kernel/sessioning/session-manager.ts23 symbols
web/src/components/ai-elements/voice-selector.tsx21 symbols
src/kernel/tasking/task-dispatcher.ts21 symbols
src/community/feishu/messaging/message-channel.ts20 symbols
web/src/components/ai-elements/speech-input.tsx19 symbols
web/src/lib/api/hooks.ts18 symbols
web/src/components/ai-elements/queue.tsx18 symbols

For agents

$ claude mcp add agentara \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact