Building an Autonomous Research Agent with C# and Local LLMs

Here's a look at a new autonomous research agent built in C# utilizing local LLMs, specifically Ollama along with the llama3.1:8b model. The agent automates the process of URL handling by generating search queries, conducting web searches through the Brave Search API, and extracting relevant data, all culminating in a structured markdown report.
Key Details
- The agent accepts a topic input, for instance, "persistent memory for AI agents".
- It autonomously formulates 5-8 search queries.
- Searches are executed via the Brave Search API, and the top sources are fetched and analyzed.
- The agent reads through 8-12 sources and extracts 5-8 key findings.
- All data processing is executed locally using the Ollama (llama3.1:8b) model without reliance on OpenAI/Anthropic APIs.
- The output is a markdown report complete with citations.
Performance and Architecture
The current setup runs on a Ryzen 5 5500, CPU-only, with 16GB RAM, taking approximately 15 minutes per research cycle. The developer notes that 3B models, such as llama3.2, are inadequate for tool calling, thereby making 8B a necessary minimum for reliable performance.
Key challenges include the need for findings truncation before synthesis to prevent the model from stalling on lengthy contexts, and occasional malformed tool calls even with 8B models, resolved by retrying with altered prompts. The agent utilizes SQLite paired with embeddings for managing memory at a personal scale, obviating the need for a vector database.
Technology Stack
- C# / .NET 8
- Ollama
- SQLite
- Brave Search API (free tier)
For developers interested in building their own agent, there's a starter kit and an 8-chapter guide available on the project's GitHub repository, provided under the MIT license, along with the full source code: hex-dynamics.
📖 Read the full source: r/LocalLLaMA
👀 See Also

Distilled Qwen 3.5 27B Model Shows Strong Performance with Cursor AI Coding Agent
A user reports that the opus 4.6 distilled version of Qwen 27B works effectively as the model driving Cursor, with performance comparable to Gemini 3 Flash. Setup took about 10 minutes using Cursor to configure ngrok tunnel and localllama.

devcontainer-mcp: Give AI Agents Their Own Dev Environment, Not Yours
devcontainer-mcp is an MCP server that exposes 45 tools for AI agents to create, manage, and work inside dev containers backed by Docker, DevPod, or GitHub Codespaces — keeping host machines clean.

MAGELLAN: A 15-Agent Autonomous Scientific Discovery System Built on Claude Code
MAGELLAN is a 15-agent autonomous scientific discovery system built entirely on Claude Code. It uses Opus for deep reasoning and Sonnet for structured tasks, generating cross-disciplinary hypotheses without human direction, with 260 hypotheses proposed and 60% killed by adversarial validation in 19 sessions.

ClamBot: AI Agent Runs LLM-Generated Code in WASM Sandbox for Security
ClamBot is an AI agent framework that executes all LLM-generated code in a WebAssembly sandbox using QuickJS in Wasmtime, eliminating the need for exec() or subprocess calls. It includes an approval gate for tool calls, persistent script caching as 'clams', and supports multiple LLM providers.