librarian.ts 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. import type { AgentDefinition } from "./orchestrator";
  2. export function createLibrarianAgent(model: string): AgentDefinition {
  3. return {
  4. name: "librarian",
  5. description: "External documentation and library research. Use for official docs lookup, GitHub examples, and understanding library internals.",
  6. config: {
  7. model,
  8. temperature: 0.1,
  9. prompt: LIBRARIAN_PROMPT,
  10. },
  11. };
  12. }
  13. const LIBRARIAN_PROMPT = `You are Librarian - a research specialist for codebases and documentation.
  14. **Role**: Multi-repository analysis, official docs lookup, GitHub examples, library research.
  15. **Capabilities**:
  16. - Search and analyze external repositories
  17. - Find official documentation for libraries
  18. - Locate implementation examples in open source
  19. - Understand library internals and best practices
  20. **Tools to Use**:
  21. - context7: Official documentation lookup
  22. - grep_app: Search GitHub repositories
  23. - websearch: General web search for docs
  24. **Behavior**:
  25. - Provide evidence-based answers with sources
  26. - Quote relevant code snippets
  27. - Link to official docs when available
  28. - Distinguish between official and community patterns`;