diff --git a/agents/librarian.json b/agents/librarian.json new file mode 100644 index 0000000..710837b --- /dev/null +++ b/agents/librarian.json @@ -0,0 +1,21 @@ +{ + "prompt": [ + "$OLLIE/x/prime SYSTEM_PROMPT", + "$OLLIE/x/prime agent-librarian", + "$OLLIE/x/prime tools-file" + ], + "maxSteps": 20, + "temperature": 0.3, + "maxTokens": 16384, + "allowExecutors": ["call_tool"], + "allowTools": [ + "file_read", + "file_glob", + "file_grep" + ], + "hooks": { + "turnError": [ + "$OLLIE/x/freeloader $OLLIE_SESSION_ID" + ] + } +} diff --git a/prompts/agent-librarian.md b/prompts/agent-librarian.md new file mode 100644 index 0000000..fe8efae --- /dev/null +++ b/prompts/agent-librarian.md @@ -0,0 +1,22 @@ +You are a knowledge curator agent. You scan, search, and read documents to answer questions, produce summaries, and synthesize information. + +# Role + +- Search and read documents in `$HOME/doc` to answer user queries. +- Summarize, compare, and synthesize information from multiple documents. +- Produce code examples, procedures, and explanations grounded in the document content. + +# Constraints + +- **Read before answering.** Always search and read relevant documents before responding. Do not answer from assumptions. +- **Cite sources.** Reference file paths when presenting information so the user can verify. +- **Stay grounded.** Base answers on document content. When synthesizing (code examples, procedures), clearly distinguish what comes from the documents vs. what you are inferring or constructing. +- **No modifications.** Do not write, edit, or delete any files. You are read-only. +- **No execute_code.** You do not run shell commands or scripts. + +# Workflow + +1. `file_grep` to locate relevant documents by keyword. +2. `file_glob` to discover documents by name or structure. +3. `file_read` to read and understand content. +4. Synthesize a response grounded in what you read. diff --git a/tools/lsp_completion b/tools/lsp_completion index 1c7883a..b164461 100755 --- a/tools/lsp_completion +++ b/tools/lsp_completion @@ -5,7 +5,7 @@ import os import sys -sys.path.insert(0, os.path.join(os.environ['OLLIE'], 't')) +sys.path.insert(0, os.path.join(os.environ['OLLIE'], 's', os.environ['OLLIE_SESSION_ID'], 't')) from _lib.lsp.client import request diff --git a/tools/lsp_definition b/tools/lsp_definition index 89e867a..4879b11 100755 --- a/tools/lsp_definition +++ b/tools/lsp_definition @@ -5,7 +5,7 @@ import os import sys -sys.path.insert(0, os.path.join(os.environ['OLLIE'], 't')) +sys.path.insert(0, os.path.join(os.environ['OLLIE'], 's', os.environ['OLLIE_SESSION_ID'], 't')) from _lib.lsp.client import request diff --git a/tools/lsp_diagnostics b/tools/lsp_diagnostics index 24286c4..c593c5d 100755 --- a/tools/lsp_diagnostics +++ b/tools/lsp_diagnostics @@ -5,7 +5,7 @@ import os import sys -sys.path.insert(0, os.path.join(os.environ['OLLIE'], 't')) +sys.path.insert(0, os.path.join(os.environ['OLLIE'], 's', os.environ['OLLIE_SESSION_ID'], 't')) from _lib.lsp.client import request diff --git a/tools/lsp_hover b/tools/lsp_hover index 9786b33..1c21c8b 100755 --- a/tools/lsp_hover +++ b/tools/lsp_hover @@ -5,7 +5,7 @@ import os import sys -sys.path.insert(0, os.path.join(os.environ['OLLIE'], 't')) +sys.path.insert(0, os.path.join(os.environ['OLLIE'], 's', os.environ['OLLIE_SESSION_ID'], 't')) from _lib.lsp.client import request diff --git a/tools/lsp_references b/tools/lsp_references index f8e869b..970a394 100755 --- a/tools/lsp_references +++ b/tools/lsp_references @@ -5,7 +5,7 @@ import os import sys -sys.path.insert(0, os.path.join(os.environ['OLLIE'], 't')) +sys.path.insert(0, os.path.join(os.environ['OLLIE'], 's', os.environ['OLLIE_SESSION_ID'], 't')) from _lib.lsp.client import request diff --git a/tools/lsp_rename b/tools/lsp_rename index 77c70c0..20f5dda 100755 --- a/tools/lsp_rename +++ b/tools/lsp_rename @@ -4,7 +4,7 @@ import os import sys -sys.path.insert(0, os.path.join(os.environ['OLLIE'], 't')) +sys.path.insert(0, os.path.join(os.environ['OLLIE'], 's', os.environ['OLLIE_SESSION_ID'], 't')) from _lib.lsp.client import request diff --git a/tools/lsp_symbols b/tools/lsp_symbols index 02b4620..8aa00b1 100755 --- a/tools/lsp_symbols +++ b/tools/lsp_symbols @@ -5,7 +5,7 @@ import os import sys -sys.path.insert(0, os.path.join(os.environ['OLLIE'], 't')) +sys.path.insert(0, os.path.join(os.environ['OLLIE'], 's', os.environ['OLLIE_SESSION_ID'], 't')) from _lib.lsp.client import request