superfly/contextwindow: A low-level library for writing Go LLM agents
github.com·2d
🔵Go
Preview
Report Post

ContextWindow: a low-level Go agentic LLM session library

ContextWindow is a straightforward library for managing conversations with LLMs. It supports tool calls, token usage tracking, summary-based compression (with an arbitrary summary model), and automatically persists conversations in SQLite.

The impetus for this library is multi-context agents. Under the hood of an LLM agent, a "context window" is simply a list of strings. LLM APIs generally don’t have a notion of "sessions". As you build up a conversation, you simply send all prompts and responses to the LLM each time (we do support previous_response_id). This means there’s no drama in having 2, 10, or 100 different "conversations" in an agent, and ContextWindow tries to make that straightforward to exp…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help