Skip to content

Commit 1b4d667

Browse files
authored
Merge pull request #81 from elizaOS/docs/updates
docs: major documentation overhaul (new guides, REST refs, fixes, navigation)
2 parents 94f22af + d4f99d9 commit 1b4d667

File tree

79 files changed

+5798
-856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5798
-856
lines changed

agents/character-interface.mdx

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
---
22
title: 'Character Interface'
3-
description: 'Complete guide to the Character configuration structure in elizaOS'
3+
description: 'Define your agent personality, knowledge, and behavior in one file'
4+
---
5+
6+
## Your First Character (2 minutes)
7+
8+
A character file is all you need to create a unique agent. Here's the minimum:
9+
10+
```typescript
11+
export const character: Character = {
12+
name: "Chef Mario",
13+
bio: "A passionate Italian chef who loves sharing recipes and cooking tips.",
14+
plugins: ["@elizaos/plugin-openai"],
15+
};
16+
```
17+
18+
That's it. Your agent now has a name, personality, and can chat. Everything else is optional.
19+
20+
<Tip>
21+
**Start minimal, add complexity later.** Most fields have sensible defaults. Only add what you need.
22+
</Tip>
23+
424
---
525

626
## Overview
@@ -511,16 +531,24 @@ export const character: Character = {
511531
<Card title="Personality & Behavior" icon="user" href="/agents/personality-and-behavior">
512532
Learn to craft unique agent personalities
513533
</Card>
514-
534+
515535
<Card title="Memory & State" icon="brain" href="/agents/memory-and-state">
516536
Understand how agents remember and learn
517537
</Card>
518-
538+
519539
<Card title="Runtime & Lifecycle" icon="play" href="/agents/runtime-and-lifecycle">
520540
See how characters become live agents
521541
</Card>
522-
542+
523543
<Card title="Plugin Development" icon="puzzle" href="/plugins/development">
524544
Extend your agent with custom plugins
525545
</Card>
546+
547+
<Card title="Core Runtime" icon="microchip" href="/runtime/core">
548+
How the runtime orchestrates your agent
549+
</Card>
550+
551+
<Card title="Deploy to Cloud" icon="cloud" href="/guides/deploy-to-cloud">
552+
Ship your agent to production in minutes
553+
</Card>
526554
</CardGroup>

agents/memory-and-state.mdx

Lines changed: 55 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,15 @@ Every piece of information an agent processes becomes a Memory:
5555
interface Memory {
5656
id?: UUID; // Unique identifier
5757
entityId: UUID; // Who created this memory (user/agent)
58+
agentId?: UUID; // Associated agent ID
5859
roomId: UUID; // Conversation context
5960
worldId?: UUID; // Broader context (e.g., server)
6061
content: Content; // The actual content
6162
embedding?: number[]; // Vector representation
62-
createdAt?: number; // Timestamp
63-
metadata?: MemoryMetadata; // Additional data
63+
createdAt?: number; // Timestamp (ms since epoch)
64+
unique?: boolean; // Prevent duplicates
65+
similarity?: number; // Similarity score (set on search)
66+
metadata?: MemoryMetadata; // Additional data
6467
}
6568

6669
interface Content {
@@ -78,21 +81,22 @@ interface Content {
7881
```typescript
7982
// Creating a memory through the runtime
8083
async function createMemory(runtime: IAgentRuntime, message: string) {
81-
const memory: CreateMemory = {
84+
const memory: Memory = {
8285
agentId: runtime.agentId,
8386
entityId: userId,
8487
roomId: currentRoom,
85-
content: {
88+
content: {
8689
text: message,
8790
metadata: {
8891
source: 'chat',
8992
processed: Date.now()
9093
}
9194
}
9295
};
93-
94-
// Runtime automatically generates embeddings if not provided
95-
const memoryId = await runtime.createMemory(memory);
96+
97+
// Runtime creates memory with table name and optional unique flag
98+
// Signature: createMemory(memory: Memory, tableName: string, unique?: boolean)
99+
const memoryId = await runtime.createMemory(memory, 'messages', true);
96100
return memoryId;
97101
}
98102
```
@@ -146,7 +150,8 @@ export class AgentRuntime {
146150
readonly #conversationLength = 32; // Default messages to consider
147151

148152
// Dynamically adjust based on token limits
149-
async buildContext(roomId: UUID): Promise<State> {
153+
// Actual signature: composeState(message: Memory, includeList?: string[], onlyInclude?: boolean, skipCache?: boolean)
154+
async composeState(message: Memory): Promise<State> {
150155
const memories = await this.getMemories({
151156
roomId,
152157
count: this.#conversationLength
@@ -235,10 +240,22 @@ State composition brings together memories and provider data:
235240
```typescript
236241
// The runtime's state composition pipeline
237242
interface State {
238-
messages: Memory[]; // Conversation history
239-
facts: string[]; // Known facts
240-
providers: ProviderData[]; // Provider contributions
241-
context: string; // Formatted context
243+
[key: string]: unknown; // Dynamic properties
244+
values: { // Key-value store for state variables
245+
[key: string]: unknown;
246+
};
247+
data: StateData; // Structured data cache (room, world, entity, providers)
248+
text: string; // String representation of context
249+
}
250+
251+
interface StateData {
252+
room?: Room; // Cached room data
253+
world?: World; // Cached world data
254+
entity?: Entity; // Cached entity data
255+
providers?: Record<string, Record<string, unknown>>; // Provider results
256+
actionPlan?: ActionPlan; // Current action plan
257+
actionResults?: ActionResult[]; // Previous action results
258+
[key: string]: unknown; // Allow dynamic properties
242259
}
243260

244261
// Provider contribution to state
@@ -443,12 +460,13 @@ async function semanticSearch(
443460
options: SearchOptions = {}
444461
): Promise<Memory[]> {
445462
const embedding = await runtime.embed(query);
446-
447-
return await runtime.searchMemoriesByEmbedding(embedding, {
463+
464+
// Signature: searchMemories(params: { embedding, query?, match_threshold?, count?, roomId? })
465+
return await runtime.searchMemories({
466+
embedding,
448467
match_threshold: options.threshold || 0.75,
449468
count: options.limit || 10,
450-
roomId: options.roomId,
451-
filter: options.filter
469+
roomId: options.roomId
452470
});
453471
}
454472

@@ -567,33 +585,27 @@ class VectorIndex {
567585
The complete state object:
568586

569587
```typescript
588+
// State is defined in packages/core/src/types/state.ts
570589
interface State {
571-
// Core conversation context
572-
messages: Memory[];
573-
recentMessages: string;
574-
575-
// Agent knowledge
576-
facts: string[];
577-
knowledge: string;
578-
579-
// Provider contributions
580-
providers: {
581-
[key: string]: {
582-
text: string;
583-
data: any;
584-
};
585-
};
586-
587-
// Composed context
588-
context: string;
589-
590-
// Metadata
591-
metadata: {
592-
roomId: UUID;
593-
entityId: UUID;
594-
timestamp: number;
595-
tokenCount: number;
590+
[key: string]: unknown; // Dynamic properties allowed
591+
592+
values: { // Key-value store populated by providers
593+
[key: string]: unknown;
596594
};
595+
596+
data: StateData; // Structured data cache
597+
598+
text: string; // Formatted text representation
599+
}
600+
601+
interface StateData {
602+
room?: Room; // Cached room data
603+
world?: World; // Cached world data
604+
entity?: Entity; // Cached entity data
605+
providers?: Record<string, Record<string, unknown>>; // Provider results cache
606+
actionPlan?: ActionPlan; // Current multi-step action plan
607+
actionResults?: ActionResult[]; // Previous action results
608+
[key: string]: unknown; // Dynamic properties
597609
}
598610
```
599611

@@ -939,7 +951,8 @@ async function debugSearch(runtime: IAgentRuntime, query: string) {
939951
// Test with different thresholds
940952
const thresholds = [0.9, 0.8, 0.7, 0.6, 0.5];
941953
for (const threshold of thresholds) {
942-
const results = await runtime.searchMemoriesByEmbedding(embedding, {
954+
const results = await runtime.searchMemories({
955+
embedding,
943956
match_threshold: threshold,
944957
count: 5
945958
});

cli-reference/agent.mdx

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,21 @@ icon: robot
1616

1717
| Subcommand | Aliases | Description | Required Options | Additional Options |
1818
| ---------- | ------- | ----------- | ---------------- | ------------------ |
19-
| `list` | `ls` | List available agents | | `-j, --json`, `-r, --remote-url <url>`, `-p, --port <port>` |
20-
| `get` | `g` | Get agent details | `-n, --name <name>` | `-j, --json`, `-o, --output [file]`, `-r, --remote-url`, `-p, --port` |
21-
| `start` | `s` | Start an agent with a character profile | One of: `-n, --name`, `--path`, `--remote-character` | `-r, --remote-url <url>`, `-p, --port <port>` |
22-
| `stop` | `st` | Stop an agent | `-n, --name <name>` | `-r, --remote-url <url>`, `-p, --port <port>` |
23-
| `remove` | `rm` | Remove an agent | `-n, --name <name>` | `-r, --remote-url <url>`, `-p, --port <port>` |
24-
| `set` | | Update agent configuration | `-n, --name <name>` AND one of: `-c, --config` OR `-f, --file` | `-r, --remote-url <url>`, `-p, --port <port>` |
25-
| `clear-memories` | `clear` | Clear all memories for an agent | `-n, --name <name>` | `-r, --remote-url <url>`, `-p, --port <port>` |
19+
| `list` | `ls` | List available agents | | `-j, --json`, `-r, --remote-url <url>`, `-p, --port <port>`, `--auth-token` |
20+
| `get` | `g` | Get agent details | `-n, --name <name>` | `-j, --json`, `-o, --output [file]`, `-r, --remote-url`, `-p, --port`, `--auth-token` |
21+
| `start` | `s` | Start an agent with a character profile | One of: `-n, --name`, `--path`, `--remote-character` | `-r, --remote-url <url>`, `-p, --port <port>`, `--auth-token` |
22+
| `stop` | `st` | Stop an agent | `-n, --name` or `--all` | `-r, --remote-url <url>`, `-p, --port <port>`, `--auth-token` |
23+
| `remove` | `rm` | Remove an agent | `-n, --name <name>` | `-r, --remote-url <url>`, `-p, --port <port>`, `--auth-token` |
24+
| `set` | | Update agent configuration | `-n, --name <name>` AND one of: `-c, --config` OR `-f, --file` | `-r, --remote-url <url>`, `-p, --port <port>`, `--auth-token` |
25+
| `clear-memories` | `clear` | Clear all memories for an agent | `-n, --name <name>` | `-r, --remote-url <url>`, `-p, --port <port>`, `--auth-token` |
2626

2727
## Options Reference
2828

2929
### Common Options (All Subcommands)
3030

3131
- `-r, --remote-url <url>`: URL of the remote agent runtime
3232
- `-p, --port <port>`: Port to listen on
33+
- `--auth-token <token>`: API authentication token for secured runtimes
3334

3435
### Output Options (for `list` and `get`)
3536

@@ -46,7 +47,12 @@ icon: robot
4647
- `--path <path>`: Path to local character JSON file
4748
- `--remote-character <url>`: URL to remote character JSON file
4849

49-
### Stop/Remove Specific Options
50+
### Stop Specific Options
51+
52+
- `-n, --name <name>`: Agent id, name, or index number from list
53+
- `--all`: Stop all running agents
54+
55+
### Remove Specific Options
5056

5157
- `-n, --name <name>`: Agent id, name, or index number from list (required)
5258

@@ -149,6 +155,9 @@ icon: robot
149155

150156
# Stop agent on remote runtime
151157
elizaos agent stop --name eliza --remote-url http://server:3000
158+
159+
# Stop all running agents
160+
elizaos agent stop --all
152161
```
153162

154163
### Removing Agents

0 commit comments

Comments
 (0)