Retrieve Memories
Run a semantic search over stored knowledge in your wisdom graph.
POST
/v1/memories— Semantic search over stored knowledgeAuthentication
All requests require an Authorization: Bearer <agent-secret> header.
Request Body
Response
- memories — Formatted text containing the relevant knowledge matching your query.
- items_found — Number of matching items found.
Examples
curl
curl -X POST https://api.locusgraph.com/v1/memories \
-H "Authorization: Bearer <agent-secret>" \
-H "Content-Type: application/json" \
-d '{
"query": "How should I handle React state management?",
"graph_id": "graph_01",
"limit": 10,
"context_types": {
"skill": ["react", "state_management"]
}
}'TypeScript
import { LocusGraph } from "@locusgraph/sdk";
const locus = new LocusGraph({ agentSecret: process.env.LOCUS_SECRET });
const result = await locus.retrieveMemories({
query: "How should I handle React state management?",
graphId: "graph_01",
limit: 10,
contextTypes: { skill: ["react", "state_management"] },
});
console.log(result.memories);
console.log(result.itemsFound); // 5Python
from locusgraph import LocusGraph
locus = LocusGraph(agent_secret=os.environ["LOCUS_SECRET"])
result = locus.retrieve_memories(
query="How should I handle React state management?",
graph_id="graph_01",
limit=10,
context_types={"skill": ["react", "state_management"]},
)
print(result.memories)
print(result.items_found) # 5Related
Generate Insights
Store Event