lerim ask¶
Ask a question using accumulated memory as context.
Overview¶
One-shot query: ask Lerim a question and get an answer informed by memories extracted from your agent sessions.
Note
This command requires a running Lerim server. Start it with lerim up (Docker) or lerim serve (direct).
Syntax¶
Parameters¶
Your question (use quotes if it contains spaces).
Maximum number of memory items to include as context.
Scope to a specific project. Note: Not yet implemented.
Output structured JSON instead of human-readable text.
Examples¶
Basic question¶
Ask about authentication patterns:
Output:
Based on your project memories, you use bearer token authentication
for API requests. This pattern was chosen for its simplicity and
compatibility with standard HTTP clients.
Limited context¶
Limit the number of memories used as context:
JSON output¶
Get structured output for parsing:
Output:
{
"question": "What testing framework do we use?",
"answer": "Your project uses pytest as the primary testing framework...",
"memories_used": 8,
"confidence": 0.87
}
How it works¶
- Your question is sent to the running Lerim server via HTTP POST to
/api/ask - Lerim performs memory retrieval to find relevant decisions and learnings
- The top N memories (default 12) are used as context
- An LLM generates an answer informed by these memories
- The answer is returned with citation evidence
Tip
For best results, ask specific questions about decisions, patterns, or procedures in your project.
Exit codes¶
- 0: Success — answer generated
- 1: Error — server not running or authentication failed
- 2: Usage error — invalid arguments
Related commands¶
-
lerim memory search
Search memories by keyword
-
lerim status
Check server status
Notes¶
- Ask uses memory retrieval evidence to ground its answers
- If provider auth fails (missing API key), the CLI returns exit code 1
- The
--projectflag is reserved for future project-scoped queries