Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ Cargo.lock
clawforge.db
sleepy_agent.json
tmp/
.claude/
memory/
/.claude/
/memory/
4 changes: 3 additions & 1 deletion backend/cli/examples/coding_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ async fn main() -> Result<()> {
allowed_domains: vec![],
max_tokens_per_run: None,
max_cost_per_run_usd: None,
..Default::default()
},
llm_policy: LlmPolicy {
providers: vec!["mock".to_string()],
Expand All @@ -50,6 +51,7 @@ async fn main() -> Result<()> {
memory_config: None,
workflow: vec![],
allowed_tools: vec!["file_write".to_string()],
allowed_skills: vec![],
};

// 3. Wiring
Expand Down Expand Up @@ -111,7 +113,7 @@ async fn main() -> Result<()> {
tokio::time::sleep(Duration::from_secs(2)).await;

// 7. Verify Log
let runs = supervisor.get_recent_runs(5)?;
let runs = supervisor.get_recent_runs(5, 0)?;
info!("Runs: {}", serde_json::to_string_pretty(&runs)?);

// 8. checks
Expand Down
4 changes: 3 additions & 1 deletion backend/cli/examples/github_pr_reviewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ async fn main() -> Result<()> {
allowed_domains: vec!["api.github.com".to_string()],
max_tokens_per_run: Some(1000),
max_cost_per_run_usd: Some(0.10),
..Default::default()
},
llm_policy: LlmPolicy {
providers: vec!["openrouter".to_string(), "ollama".to_string()],
Expand All @@ -65,6 +66,7 @@ async fn main() -> Result<()> {
},
],
allowed_tools: vec![],
allowed_skills: vec![],
};

info!(agent_id = %pr_reviewer.id, "Defined PR Reviewer agent");
Expand Down Expand Up @@ -136,7 +138,7 @@ async fn main() -> Result<()> {
tokio::time::sleep(Duration::from_secs(5)).await;

// 9. Check results
let runs = supervisor.get_recent_runs(10)?;
let runs = supervisor.get_recent_runs(10, 0)?;
info!("Demo finished. Recent runs: {}", serde_json::to_string_pretty(&runs)?);

Ok(())
Expand Down
10 changes: 8 additions & 2 deletions backend/cli/examples/research_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ use clawforge_core::{
types::{MemoryConfig, Role},
};
use clawforge_executor::Executor;
use clawforge_memory::{InMemoryVectorStore, MemoryStore, VectorEntry, MemoryQuery};
use clawforge_memory::{InMemoryVectorStore, MemoryStore};
use clawforge_memory::types::{VectorEntry, MemoryQuery};
use clawforge_planner::providers::ProviderRegistry;
use clawforge_planner::LlmPlanner;
use clawforge_scheduler::Scheduler;
Expand Down Expand Up @@ -41,6 +42,7 @@ impl Component for MemoryService {
vector: req.query_vector,
min_score: req.min_score,
limit: req.limit,
..Default::default()
};

match self.store.search(query).await {
Expand Down Expand Up @@ -93,6 +95,7 @@ async fn run_memory_service(
vector: req.query_vector,
min_score: req.min_score,
limit: req.limit,
..Default::default()
};

if let Ok(results) = store.search(query).await {
Expand Down Expand Up @@ -130,6 +133,8 @@ async fn main() -> Result<()> {
content: "Rust 1.75 stabilized async traits in traits.".to_string(),
vector: vec![0.0; 1536], // Mock vector
metadata: serde_json::json!({"source": "manual_entry"}),
created_at: 0,
session_id: None,
};
memory_store.upsert(fact1).await?;

Expand All @@ -154,6 +159,7 @@ async fn main() -> Result<()> {
}),
workflow: vec![],
allowed_tools: vec![],
allowed_skills: vec![],
};

// 3. Wiring
Expand Down Expand Up @@ -217,7 +223,7 @@ async fn main() -> Result<()> {
tokio::time::sleep(Duration::from_secs(3)).await;

// 6. Verify Log
let runs = supervisor.get_recent_runs(10)?;
let runs = supervisor.get_recent_runs(10, 0)?;
info!("Recent runs: {}", serde_json::to_string_pretty(&runs)?);

Ok(())
Expand Down
5 changes: 5 additions & 0 deletions backend/memory/src/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,17 @@ mod tests {
content: "The cat sits on the mat".to_string(),
vector: vec![1.0, 0.0, 0.0],
metadata: serde_json::json!({}),
created_at: 0,
session_id: None,
};

let entry2 = VectorEntry {
id: Uuid::new_v4(),
content: "The dog barks at the mailman".to_string(),
vector: vec![0.0, 1.0, 0.0],
metadata: serde_json::json!({}),
created_at: 0,
session_id: None,
};

store.upsert(entry1.clone()).await.unwrap();
Expand All @@ -120,6 +124,7 @@ mod tests {
vector: vec![0.9, 0.1, 0.0],
min_score: 0.5,
limit: 1,
..Default::default()
};

let results = store.search(query).await.unwrap();
Expand Down
1 change: 1 addition & 0 deletions backend/scheduler/src/scheduler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ mod tests {
memory_config: None,
workflow: vec![],
allowed_tools: vec![],
allowed_skills: vec![],
}
}

Expand Down
Loading