Skip to content

API Reference

Complete API documentation for all Neurosurfer modules and classes.

📚 Quick Navigation


🔍 Module Overview

Core Modules

Module Description Key Classes
Agents AI agents for various tasks ReActAgent, SQLAgent, RAGRetrieverAgent
Models LLM and embedding models OpenAIModel, AnthropicModel, OllamaModel

Data & Retrieval

Module Description Key Classes
RAG Retrieval-augmented generation Chunker, FileReader, RAGIngestor
Vector Stores Vector databases ChromaVectorStore, BaseVectorDB
Database SQL database utilities SQLDatabase

Tools & Extensions

Module Description Key Classes
Tools Agent tools and toolkit BaseTool, Toolkit, ToolSpec
Server Production API server NeurosurferApp, API endpoints

🎯 Common Use Cases

Building Agents

from neurosurfer import ReActAgent
from neurosurfer.models.chat_models.openai import OpenAIModel

model = OpenAIModel(model_name="gpt-4")
agent = ReActAgent(model=model, tools=tools)

See: ReActAgent | Models | Tools

RAG Document Q&A

from neurosurfer import RAGRetrieverAgent
from neurosurfer.rag import RAGIngestor
from neurosurfer.vectorstores import ChromaVectorStore

ingestor = RAGIngestor(embedder=embedder, vectorstore=chroma)
agent = RAGRetrieverAgent(model=model, vectorstore=chroma)

See: RAGIngestor | ChromaVectorStore

SQL Database Queries

from neurosurfer import SQLAgent
from neurosurfer.db import SQLDatabase

db = SQLDatabase("postgresql://...")
agent = SQLAgent(model=model, database=db)

See: SQLAgent | SQLDatabase


📖 Documentation Conventions

Type Hints

All parameters and return values include type hints:

def method(param: str, count: int = 10) -> List[str]:
    ...

Optional Parameters

Parameters with defaults are marked:

Parameter Type Default Description
required_param str required Must be provided
optional_param int 10 Has default value

Examples

All methods include working examples:

# Always tested and runnable
result = agent.run("example query")

🔗 External References


💡 Tips for Using API Docs

Start with Overview

Each section has an overview page explaining concepts before diving into specific classes.

Follow Examples

All code examples are tested and ready to copy-paste.

Check Related Classes

Use "See Also" sections to discover related functionality.


Ready to explore? Start with Agents → or Models →