GoCP is a Go-based AI copilot that works with Ollama LLMs, supporting automatic tool calling and RAG (Retrieval-Augmented Generation) for querying PDFs and live data — all from the terminal.
🤖 Terminal-based AI chat with Ollama
🔧 Automatic tool calling (Wikipedia, web search, crypto prices)
📄 RAG support for querying PDF documents
🔍 DuckDuckGo web search
💰 Real-time crypto prices via CoinGecko
🧠 Context pruning & conversation memory
🎯 Interactive model selection at startup
GoCP/
├── server/ # Tool execution & APIs (port 8080)
└── client/ # CLI chat client with RAG
Server: Tool registry, execution engine, APIs
Client: Chat UI, Ollama interaction, RAG pipeline
- Go 1.21+
- Ollama (running locally)
Recommended Models:
ollama pull llama3.1:8b
ollama pull qwen2.5:7b
ollama pull nomic-embed-text # Required for RAGgit clone <repo-url>
cd GoCP
# Build Server
cd server
go mod tidy
go build -o gocp-server
# Build Client
cd ../client
go mod tidy
go build -o gocp-clientserver/.env
PORT=8080client/.env
OLLAMA_API_URL=http://localhost:11434
SERVER_URL=http://localhost:8080Terminal 1 — Server
cd server
./gocp-serverTerminal 2 — Client
cd client
./gocp-clientYou'll be prompted to select a model and can start chatting immediately.
Ask Questions (Auto Tool Calling)
GoCP> What happened in tech today?
[🔧 Tool Called: web search]
Crypto Prices
GoCP> What's the Bitcoin price?
[🔧 Tool Called: Crypto]
Web Search
GoCP> Tell me about Alan Turing
[🔧 Tool Called: web search]
PDF RAG
GoCP> rag it
[📄 RAG Context Retrieved]
To Exit
GoCP> exit
| Tool | Purpose |
|---|---|
| fetching_wikipedia | Encyclopedic knowledge |
| fetching_crypto | Live crypto prices |
| fetching_online | Web search |
| RAG | Semantic search over PDFs |
Tools are automatically selected by the model.
- Define schema in
server/schema/tools.json - Implement logic in
server/tool_internals/ - Add wrapper in
server/tools/ - Register in
server/registery/ - Restart server → tool becomes available
Ollama not responding
ollama serve
curl http://localhost:11434/api/tagsServer not reachable
curl http://localhost:8080/healthRAG not working
ollama pull nomic-embed-text- Use 8B models for best tool-calling
- Ensure at least 8–16GB RAM
- RAG context is auto-pruned for efficiency
Planned and upcoming enhancements for GoCP:
- Local symbol registry (stocks, ETFs, metals)
- Asset name → symbol resolution (no hallucination)
- Futures contracts support (e.g. GC=F, CL=F)
- Exchange-aware resolution (NASDAQ, NYSE, NSE)
- Multi-PDF indexing
- Chunk relevance scoring
- Persistent document memory per session
- Hybrid RAG (local + web)
- Tool routing enforcement at code level
- Tool confidence scoring
- Pluggable tool backends
- Rate-limit aware fallbacks
- Streaming responses
- Better context pruning
- Session save / restore
- Configurable memory depth
- Zero-hallucination symbol policy
- Explicit clarification on ambiguity
- Deterministic tool execution
- Fork the repo
- Create a feature branch
- Add code + tests
- Open a PR 🚀
Built with ❤️ using Go & Ollama
Last updated: Jan 28, 2026