Agents

Agent Class

The Agent class is a fundamental component of the Cultura framework, designed to execute tasks autonomously. It fuses LLMs, tools, and long-term memory capabilities to create a full-stack agent. The Agent class is highly customizable, allowing for fine-grained control over its behavior and interactions.

run Method

The run method is the primary entry point for executing tasks with an Agent instance. It accepts a task string as the main input task and processes it according to the agent's configuration. Additionally, it can accept an img parameter such as img="image_filepath.png" to process images if you have a VLM attached such as DeepseekVL.

Simple Example

pythonCopyfrom cultura import Agent

agent = Agent(
    agent_name="Stock-Analysis-Agent",
    model_name="deepseek-r1",
    max_loops="auto",
    interactive=True,
    streaming_on=True,
)

agent.run("What is the current market trend for tech stocks?")

Settings and Customization

The Agent class offers a range of settings to tailor its behavior to specific needs. Some key settings include:

Integrating RAG with Cultura for Enhanced Long-Term Memory

Agent equipped with quasi-infinite long-term memory using RAG (Relational Agent Graph) for advanced document understanding, analysis, and retrieval capabilities.

Mermaid Diagram for RAG Integration

Misc Agent Settings

We provide a vast array of features to save agent states using JSON, YAML, TOML, upload PDFs, batched jobs, and much more!

Method Table

Agent with Pydantic BaseModel as Output Type

The following is an example of an agent that intakes a Pydantic BaseModel and outputs it at the same time:

Multi-Modal Autonomous Agent

Run the agent with multiple modalities useful for various real-world tasks in manufacturing, logistics, and health.

Local Agent ToolAgent

ToolAgent is a fully local agent that can use tools through JSON function calling. It intakes any open-source model from Hugging Face and is extremely modular and plug-and-play. We need help adding general support to all models soon.


Additional Notes

  • Environment Variables: Ensure that all necessary environment variables (e.g., DEEPSEEK_API_KEY) are properly set in your .env file when running multi-modal agents or any other agents requiring API access.

  • Dependencies: Make sure to install all required dependencies for the Cultura framework, including but not limited to pydantic, transformers, and any other libraries referenced in the examples.

  • Long-Term Memory Management: When integrating long-term memory with RAG, ensure that the ChromaDB is correctly configured and that the docs_folder is specified if needed.

  • Schema Definitions: When using Pydantic BaseModel for schemas, ensure that your schemas are well-defined and validated to prevent runtime errors.

If you encounter any issues or need further customization, feel free to consult the Cultura framework documentation or reach out to the support community.

Last updated